Skip to content

Mock JWT with claims with no JwtAuthenticationConverter #158

Answered by ch4mpy
ancavar asked this question in Q&A
Discussion options

You must be logged in to vote

Thank you. This confirms you are testing components within a resource server with JWT decoder and that @WithJwt is actually what is adapted to your case.

I hadn't noticed that the default authentication converter is not exposed as a bean: it is just instantiated by the OAuth2ResourceServerConfigurer.JwtConfigurer if no JwtAuthenticationConverter bean is found in the context (I thought so far that there was a @CondionalOnMissingBean JwtAuthenticationConverter). I will open a bug to fix that and use a JwtAuthenticationConverter instance if no Converter<Jwt, ? extends AbstractAuthenticationToken> is found in the test context.

What you can do until I release a new version is, in your security…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@ancavar
Comment options

@ch4mpy
Comment options

Answer selected by ancavar
@ch4mpy
Comment options

@ancavar
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants