Skip to content
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

Problem with policies/invite code after .net 8 upgrade: GetRSAPublicKey() method comes back null and throws exception "Certificate is not an RSA certificate" #631

Open
tomtrost opened this issue Aug 22, 2024 · 1 comment

Comments

@tomtrost
Copy link

Hello. I can't seem to find any documentation or workaround for this issue. I am having an issue wit the .well-known/keys endpoint in the Oidc controller after porting it into my .NET 8 project. I have the policies/invite code running locally and accessing a signed certificate and this endpoint works great, however it doesn't work great when ported into my project. The main difference: my project is .NET 8 whereas the example code is .NET Core 3.1. Consequently, the Microsoft.IdentityModel.Tokens Nuget package (I think that's the culprit) is version 8.0.0 as opposed to 6.6.0 that I have running on the "invite" code.

I noticed that GetRSAPublicKey() method in the jwksModel is returning null, which is throwing that error. I also noticed that this method has quite different approaches after stepping into the different versions. Both projects are processing the exact same signed certificate and seem to be passing similar values into their respective DecodePublicKey methods. I am really at a loss here. I've stepped into the code to try to figure out what's wrong, but end up pretty far "into the weeds" with the cryptographic parsing that goes on. Any advice would be GREATLY appreciated!

@tomtrost
Copy link
Author

tomtrost commented Aug 22, 2024

Solved per vcsjones reply here: dotnet/runtime#86845 (comment)

@tomtrost tomtrost changed the title Problem with policies/invite code after .net 8 upgrade: GetRSAPublicKey() method comes back null and throws exception "Certificate is not an RSA certificate Problem with policies/invite code after .net 8 upgrade: GetRSAPublicKey() method comes back null and throws exception "Certificate is not an RSA certificate" Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant