Configurable authentication converter for resource-servers with token introspection #11661
Labels
in: oauth2
An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)
type: enhancement
A general enhancement
Milestone
Expected Behavior
Something like the
JwtAuthenticationConverter
but for token instrospection.My first thougt is, inside
OpaqueTokenAuthenticationProvider
, delegateAbstractAuthenticationToken convert(OAuth2AuthenticatedPrincipal principal, String token)
to a configurable bean.As we already have the possibility to configure the introspector, an other option would be bypassing the call to
convert
when introspector return value implements bothAuthenticatedPrincipal
andAuthentication
. This option has minimal impact on code base, but is probably less flexible (and clean) than preceding one.Current Behavior
We have no hand on the type of
Authentication
returned byOpaqueTokenAuthenticationProvider
(at least, none I could find)Context
I'm writing a spring-boot resource-server with token introspection and would like to:
realm_access.roles
andresource_access.{client-id}.roles
, not inscope
(which is used for ... scopes). Other vendors could put it ingroups
.BearerTokenAuthentication
Ideally, introspection process would not be touched. Just add a sort of post-preccssing to successful introspections.
Overriding
introspector
for just altering autorities mapping is overkill and I'd like to keep default introspector: if it is found out that Nimbus introspector should be updated or replaced whith another implementation for whatever security or performance reason, I'd like to benefit it (which won't happen if it is overriden for authorities mapping).The text was updated successfully, but these errors were encountered: