spring-projects / spring-authorization-server

Spring Authorization Server
https://spring.io/projects/spring-authorization-server
Apache License 2.0
4.78k stars 1.25k forks source link

AuthorizationServerContextHolder.getContext() is null #1655

Closed g88827929g closed 1 week ago

g88827929g commented 1 week ago

DefaultOAuth2TokenContext tokenContext = DefaultOAuth2TokenContext.builder() .registeredClient(registeredClient) .authorizationServerContext(AuthorizationServerContextHolder.getContext()) .principal(authenticate) .authorizationGrantType(AuthorizationGrantType.JWT_BEARER) .authorizedScopes(scopes) .tokenType(OAuth2TokenType.ACCESS_TOKEN) .build(); OAuth2Token accessToken = tokenGenerator.generate(tokenContext);

AuthorizationServerContextHolder. getContext() is null. How can I obtain AuthorizationServerContext to create a jwt token

jgrandja commented 1 week ago

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.