-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Expose strategy for converting Introspection Response into Authentication #6830
Comments
I realize this is probably not finalized, but I'm wondering if we need introspection in the method name? |
I think it depends on the contract. For JWT, the code is: http
.oauth2ResourceServer()
.jwt()
.jwtAuthenticationConverter(...) And that's because the contract is The contract here isn't quite as clear since it would require both the token and its attributes, which there isn't a class for like there is for |
@jzheaux, couldn't both method be What is the value of having the opaque string of a token, headers, signature or other upstream validation data inside the Once decoded, is a token more than a claim-set? Those are questions I had for two month or so, which gave me time to explore a bit around it. You can find, in this repo (you already have cloned), what I've done around Its main interest being it's generic: takes the token claims type as parameter. Yes, I've also derived |
The Opaque Token API has undergone a fair amount of change since this ticket was created. While I still feel like there is value in continuing to consider this feature, it's fairly simple at this point to customize the authorities with a simple override of @Bean
public OpaqueTokenIntrospector introspector() {
OpaqueTokenIntrospector delegate = new NimbusOpaqueTokenIntrospector(...);
return token -> {
OAuth2AuthenticatedPrincipal principal = delegate.introspect(token);
Collection<GrantedAuthority> mapped = mapAuthorities(principal);
return new DefaultOAuth2AuthenticatedPrincipal(
principal.getName(), principal.getAttributes(), mapped);
}
} |
@jzheaux Should we still consider this or should we close? |
I would still like this, as our application needs to convert from an opaque token into a User object. |
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue. |
Related to #5629
Like it is for Resource Server JWT support, it should be simple to customize the authentication token that gets returned from the introspection support, e.g.:
We should add support for this both on the servlet and on the reactive sides.
The text was updated successfully, but these errors were encountered: