0

I am having string value in iss but spring security is expecting iss value as URL.. Is it possible to change some bean to accept string value instead of URL.

6
  • Could you please provide a stacktrace? May 21, 2020 at 13:18
  • java.lang.IllegalArgumentException: Unable to convert claim 'iss' of type 'class java.lang.String' to URL. at org.springframework.security.oauth2.core.ClaimAccessor.getClaimAsURL(ClaimAccessor.java:122) ~[spring-security-oauth2-core-5.2.2.RELEASE.jar:5.2.2.RELEASE] May 22, 2020 at 7:26
  • 1
    @Bean public JwtDecoderFactory<ClientRegistration> idTokenDecoderFactory() { OidcIdTokenDecoderFactory idTokenDecoderFactory = new OidcIdTokenDecoderFactory(); OAuth2TokenValidator<Jwt> withIssuer = JwtValidators.createDefaultWithIssuer("string value"); idTokenDecoderFactory.setJwtValidatorFactory(clientRegistration -> withIssuer); return idTokenDecoderFactory; } i found some work around adding this bean and its started working.. I am not sure this is the proper way to move forward May 22, 2020 at 7:27
  • Creating a JwtDecoderFactory bean is valid, since the issuer is known. Going back to the original problem, it appears the "iss" claim is not a valid URL. Do you know what the "iss" claim contains? May 22, 2020 at 14:08
  • its just a string like "provider".. Its not a URL May 23, 2020 at 10:07

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.