question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OIDC introspection of opaque access-token does not fill principal of SecurityIdentity

See original GitHub issue

Describe 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. image

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:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
sberyozkincommented, Nov 4, 2020

@haraldatbmw you can also reset a principal in a custom SecurityIdentityAugmentor, UserInfo is available as a SecurityIdentity userinfo attribute

1reaction
sberyozkincommented, Oct 22, 2020

Labelling it as an enhancement since the introspection response uses a non-standard property

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found