-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.NET 8.0 incompatibility with HS256 #47
Comments
I encountered the same issue and solved it by cleaning old keys from the ASP.NET DataProtection folder, eg: |
I encountered the same problem but I didn't update to .net 8.0. I use persistence with entity framework (MSSQL). The key parameters were left blank for no apparent reason. We resolved this by deleting the table and restarting the API (workaround). |
Having the same issue here. Will try to clear up the table as others suggested. |
Well If it helps here's an example. I create a key in .NET 7 and here's what I got in Parameters JSON in .NET 8 (Something that should become ):
Natively created key in .NET 8
Well the thing is that this is of course incompatible. Any recommendations to avoid it in the future? Maybe serialize in manually? JsonWebKey class is Microsoft.IdentityModel.Tokens versions 6.26.1 vs 7.4.0 |
Ok I found a fix. Can you please make a new build?
|
I use
IJwtService
with the following code to generate access token:I get here:
System.NotSupportedException: 'IDX10621: 'Microsoft.IdentityModel.Tokens.SymmetricSignatureProvider' supports: 'Microsoft.IdentityModel.Tokens.SecurityKey' of types: 'Microsoft.IdentityModel.Tokens.AsymmetricSecurityKey' or 'Microsoft.IdentityModel.Tokens.SymmetricSecurityKey'. SecurityKey received was of type 'Microsoft.IdentityModel.Tokens.JsonWebKey'.'
Might be related to
Workaround is not to use HS256
The text was updated successfully, but these errors were encountered: