Describe the bug
Hi, I'm trying to set up a resource server that validates ID and Access Tokens from my SPA with Azure Accounts. The issuer-uri that I'm using is https://login.microsoft.com/tenant-id/v2.0/.well-known/openid-configuration.
I set up a custom jwtDecoder for verifying incoming tokens inside my security configuration:
@Value("${azure.activedirectory.tenant-id}")
@Value("${spring.security.oauth2.resourceserver.jwt.issuer-uri}")
JwtDecoder jwtDecoder() {
OAuth2TokenValidator<Jwt> withAudience = new AudienceValidator(audience);
OAuth2TokenValidator<Jwt> withIssuer = JwtValidators.createDefaultWithIssuer(issuer);
OAuth2TokenValidator<Jwt> validator = new DelegatingOAuth2TokenValidator<>(withAudience, withIssuer);
NimbusJwtDecoder jwtDecoder = (NimbusJwtDecoder) JwtDecoders.fromOidcIssuerLocation(issuer);
jwtDecoder.setJwtValidator(validator);
return jwtDecoder;
}
I get the following error:
Unable to resolve the Configuration with the provided Issuer of "https://login.microsoftonline.com/tenant-id/v2.0/.well-known/openid-configuration
I'm unsure about the format that is expected for the issuer-uri and don't know which URI to really use (the microsoft docs don't provide any help for this). Is there a sample project that uses maybe a /commons/ microsoft endpoint, so that I can get an idea about the format?
Thank you all Alex
Comment From: eleftherias
Thanks for getting in touch, but it feels like this is a question that would be better suited to Stack Overflow. We prefer to use GitHub issues only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add a minimal sample that reproduces this issue if you feel this is a genuine bug.