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

Issuer verification failed (Okta + Ktor + SwaggerUI) #143

Open
BlackHornet opened this issue Dec 19, 2022 · 1 comment
Open

Issuer verification failed (Okta + Ktor + SwaggerUI) #143

BlackHornet opened this issue Dec 19, 2022 · 1 comment
Assignees

Comments

@BlackHornet
Copy link

BlackHornet commented Dec 19, 2022

Hello,

currently I have an issue with my api authentication.

Setup:
I'm building a basic Ktor API and provided an Authentication feature to validate Okta accessTokens.

Via a swagger UI I login at okta and retrieve my accessToken, which contains an issuer:
"iss": "https://dev-ylqkdtaqkg6cqazy.eu.auth0.com/"

When I am using the accessTokenVerifier to validate and verify the incoming accessToken using the following builder

JwtVerifiers.accessTokenVerifierBuilder()
    .setIssuer("https://dev-ylqkdtaqkg6cqazy.eu.auth0.com/")
    .setAudience("api://default")
    .build()

I get an exception that issuer claim does not match
Caused by: io.jsonwebtoken.IncorrectClaimException: Expected iss claim to be: https://dev-ylqkdtaqkg6cqazy.eu.auth0.com, but was: https://dev-ylqkdtaqkg6cqazy.eu.auth0.com/.

Checking the BaseVerifierBuilderSupport it seams like the trailing slash was removed, when setIssuer() is called

What can I do, as the issuer in the accessToken comes from auth0 as well. See my openid-configuration
https://dev-ylqkdtaqkg6cqazy.eu.auth0.com/.well-known/openid-configuration

Regards

@arvindkrishnakumar-okta
Copy link
Contributor

@BlackHornet Thanks for posting! I'll take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants