OIDC introspection of opaque access-token does not fill principal of SecurityIdentity
See original GitHub issueDescribe the bug My service uses OIDC (application-type=service) and is called with an opaque access-token. The REST endpoints are protected with @RolesAllowed annotations.
Because of the opaque access-token, the introspect endpoint is called by Quarkus/Vert.x to get the JWT. Because my identity-provider is ForgeRock the response of the introspection endpoint does not contain a key “username” but “user_id”.
Response:
{
"active": true,
"scope": "openid profile email myroles",
"client_id": "***",
"user_id": "***",
"token_type": "Bearer",
"exp": 1602839252,
"sub": "***",
"iss": "***",
"auth_level": 1000,
"auditTrackingId": "***"
}
The Vert.x and Quarkus-implementation expect the “username” key, so the principal of the SecurityIdentity is not filled.
See:
- io.quarkus.oidc.runtime.OidcIdentityProvider.validateTokenWithOidcServer
- io.vertx.ext.auth.oauth2.impl.OAuth2TokenImpl.introspect
Expected behavior Principal of SecurityIdentity gets filled.
Actual behavior Principal is null
Configuration
quarkus.oidc.application-type=service
quarkus.oidc.auth-server-url=***
quarkus.oidc.client-id=***
quarkus.oidc.credentials.client-secret.value=***
quarkus.oidc.token.issuer=***
quarkus.oidc.authentication.user-info-required=true
quarkus.oidc.roles.source=userinfo
quarkus.oidc.roles.role-claim-path=myroles
quarkus.oidc.discovery-enabled=false
quarkus.oidc.introspection-path=/introspect
quarkus.oidc.user-info-path=/userinfo
Environment (please complete the following information):
- Quarkus version or git rev: 1.9.0.CR1
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Using OpenID Connect (OIDC) to Protect Service Applications ...
This property must be set if OIDC discovery is disabled and 1) the opaque bearer access tokens have to be verified or 2)...
Read more >Invoking the Introspection Endpoint for OpenID Connect - IBM
Information that is contained within access tokens that are used in OpenID Connect and OAuth 2.0 is opaque to clients. This can enable...
Read more >Opaque access token introspection - Auth0 Community
The problem I have is that the access_token returned from Auth0 is opaque - but there is no introspection endpoint to validate it...
Read more >io.vertx.ext.auth.oauth2.AccessToken Java Examples
failedFuture("AccessToken is not a valid JWT")); return; } String[] parts ... as a JWT or an opaque token, possibly involving // an introspection...
Read more >Microsoft identity platform ID tokens
This is not returned on ID tokens from the /token endpoint. aio, Opaque String, An internal claim used by Azure AD to record...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@haraldatbmw you can also reset a principal in a custom
SecurityIdentityAugmentor
,UserInfo
is available as aSecurityIdentity
userinfo
attributeLabelling it as an enhancement since the introspection response uses a non-standard property