Skip to content

Conversation

aniket-okta
Copy link
Contributor

Summary

This pull request resolves a critical SecurityTokenSignatureKeyNotFoundException that occurs during JWT validation when Okta.AspNetCore and Okta.Sdk are used together.

The fix involves upgrading core Microsoft identity packages and refactoring the authentication logic to be compatible with the modern libraries.

What's Changed?

  • ⬆️ Upgraded Dependencies: Updated System.IdentityModel.Tokens.Jwt and Microsoft.IdentityModel.JsonWebTokens to their latest versions to resolve dependency conflicts.
  • 🗑️ Removed Deprecated Library: Eliminated the deprecated IdentityModel.Client package.
  • ♻️ Refactored UserInfo Endpoint: The UserInformationProvider class has been updated to use the standard System.Net.Http.HttpClient instead of the legacy client.
  • 🛠️ Fixed Token Validation: Implemented a custom AuthenticationBuilder extension to correctly handle token validation with the new JsonWebToken type, ensuring that signing keys are properly retrieved from the OIDC discovery document.

Why This Change Was Needed

A dependency conflict between Okta.AspNetCore (which relied on IdentityModel v6) and Okta.Sdk (which uses v7+) caused the token validation process to fail with the error IDX10500: Signature validation failed. The newer libraries return a JsonWebToken instead of a JwtSecurityToken, which the existing AddOktaWebApi method could not handle. This change modernizes our authentication pipeline and makes it robust.

Related Issues

@aniket-okta aniket-okta self-assigned this Jun 16, 2025
@aniket-okta aniket-okta merged commit a0667e5 into master Jun 16, 2025
2 checks passed
@aniket-okta aniket-okta deleted the OKTA-811798 branch June 16, 2025 07:54
@jforage-sw
Copy link

@aniket-okta Is there any reason why release 4.6.4 hasn't been pushed to NuGet yet?

@aniket-okta
Copy link
Contributor Author

Hi @jforage-sw,

We’re currently facing an Artifactory authentication issue on our end, which is preventing us from completing the release process.
We’re actively working on resolving this and will try to get the release (4.6.4) pushed to NuGet as soon as possible.

Thanks for your patience!

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

Successfully merging this pull request may close these issues.

Token validation fails when referencing the latest versions of Okta.AspNetCore and Okta.Sdk
3 participants