"TypeInitializationException" received while generating token #290
Replies: 1 comment
-
Your statement "Latest Duende IdentityServer works with latest Microsoft.AspNetCore.ApiAuthorization.IdentityServer (v7), which have a bug dotnet/aspnetcore#57310" is not entirely correct. It also seems that you're trying to use IdentityServer 5.2.0 on .NET 9: this was never intended to be supported, and unfortunately, we stopped supporting IdentityServer v5 on December 13, 2022 already. Currently, we only support IdentityServer v7. We strongly suggest updating IdentityServer to the latest version. Not only because of updates (including security fixes) we've done, but also to ensure that you're using a recent and supported version of ASP.NET Core. If you still need |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Which version of Duende IdentityServer are you using?
5.2.0
Which version of .NET are you using?
9.0
Other relevant libraries?
Microsoft.AspNetCore.Api 6.0.3
AutoMapper 10.0.0
Duende IdentityServer 5.2.0 is deprecated, why are you not using latest version?
Latest Duende IdentityServer works with latest Microsoft.AspNetCore.ApiAuthorization.IdentityServer (v7), which have a bug dotnet/aspnetcore#57310
Therefore using v7 is not possible
Describe the bug:
When creating token, exception is generated. Register is working fine. Tried it with minimal web api and entityframework without jwt or mvc. using/inheriting from default dbcontext(for ef migration) without any custom change.
Here is the exception received on url configured https://localhost:7261/connect/token
Relevant code
program.cs
Dependencies.cs
ApplicationDbContext.cs
Relevant calls for reproducibility:
POST (json): https://localhost:7261/Account/Register
{
"email": "[email protected]",
"password": "SecurePassword123!",
"confirmPassword": "SecurePassword123!"
}
POST(x-www-form-urlencoded): https://localhost:7261/connect/token
client_id:react
client_secret:secret
grant_type:password
username:[email protected]
password:SecurePassword123!
scope:openid profile api1
To Reproduce:
Expected behavior:
"https://localhost:7261/connect/token" call should respond with generated token if logic successful.
Beta Was this translation helpful? Give feedback.
All reactions