-
Notifications
You must be signed in to change notification settings - Fork 41.1k
Add configuration support for Opaque Token authentication #15872
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
Comments
@jzheaux Would it possible to validate JWTs using the introspection endpoint or is it just for opaque tokens? |
Yes, the spec does mention this so some providers may support accepting JWT's on Introspect Endpoint |
In this case, a JWT is an opaque token. The resource server, when using opaque tokens, is not concerned with its underlying format. It obtains the contents of the token only through the introspection response. |
@jgrandja I know the spec mentions this, my question was more about does Spring Security support it.
@jzheaux I wonder if that terminology might be confusing to users. We have a |
@mbhave That might not have been the clearest way for me to put it, let me try again here. An opaque token is simply a token whose format the resource server doesn't care about. Sure, it could be a JWT, but it could also be internal and proprietary. To state And Regarding the spec, it only mentions JWTs in the introduction as a means to explain the rationale for the spec. It does not indicate JWTs as an expected use case for introspection. In fact, the spec calls out that JWT is a means of inspection independent of any remote endpoint:
Thus, the case for using Does that help? If not, could you help me see more clearly where the spots are for potential confusion? |
Thanks @jzheaux. I do understand Taking the example that you've linked to, there is a distinction between the two kinds of tokens. For
My feeling is that for users who choose to use the introspection endpoint for
Possibly because if you inspect the token yourself, you most likely cache the keys and there's a chance of the keys being out of sync with the authorization-server. So you'd rather always validate it with the authorization-server. I think the main point I want to make is I don't see an opaque token as something whose format the resource server doesn't care about but more as something that is not a self-contained token. Having the |
This distinction is why I would suppose that the 95% case is that the user would pick
I suppose if a user wanted to explicitly state that they are using JWTs and wanted to stick with the JWT format (e.g. get a @Bean
public JwtDecoder jwtDecoder() {
return new MyRemoteIntrospectingJwtDecoder();
} which would be like the hypothetical Spring Security does not yet support something like this--getting a |
The corresponding changes in Spring Security will be available in |
@jzheaux mentioned that they're looking at finding a new home for client id and secret. I'll mark this one as blocked till then. |
@jzheaux Is there an issue we can keep an eye on for client id and secret finding a new home? |
Sorry, @wilkinsona, I failed to state that I'd updated the ticket with our updated recommendation. The recommendation originally was:
which @mbhave correctly pointed out feels pretty redundant. I think a better setup is:
Is this a workable solution? |
That makes sense to me. I've unblocked the issue. |
In Spring Security 5.2.0.M2, users can configure the OAuth 2.0 Resource Server to validate opaque tokens through Introspection:
It would be nice if this could be property-driven, e.g.:
Then, Spring Boot could register an instance of
OAuth2TokenIntrospectionClient
:Note that this configuration is only valid if
OAuth2IntrospectionAuthenticationToken
is on the classpath.The text was updated successfully, but these errors were encountered: