-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
OIDC introspection of opaque access-token does not fill principal of SecurityIdentity #12755
Comments
@haraldatbmw Unfortunately it will take awhile to fix it given that all the unrecognized values are dropped in Vert.x. |
@sberyozkin Yes sure that will be a valid workaround. I was wondering if all the keys that Vert.x is using are not standardized but the values KeyCloak uses. |
@haraldatbmw |
Labelling it as an enhancement since the introspection response uses a non-standard property |
@haraldatbmw quick question, do you have the required user name returned in the userinfo response ? It may be easier to resolve it via that route |
@sberyozkin yes, userinfo-data is my current fallback for this issue. @Inject
SecurityIdentity securityIdentity;
@Inject
UserInfo userInfo;
@GET
@RolesAllowed({"xyz"})
public String getData() {
// principal is null because json of introspection call does not contain a key "username"
var principal = securityIdentity.getPrincipal();
var sub = userInfo.getString("sub");
var roles = securityIdentity.getRoles();
... |
@haraldatbmw you can also reset a principal in a custom |
Hello @sberyozkin, I believe that
breaks the possibility for an easy workaround using a According to RFC 7662, There should either be a fallback to |
@KarstenWintermann sorry I've noticed this message only after seeing your PR. Let me check |
@KarstenWintermann I see, sorry about that - I think |
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:
The Vert.x and Quarkus-implementation expect the "username" key, so the principal of the SecurityIdentity is not filled.
See:
Expected behavior
Principal of SecurityIdentity gets filled.
Actual behavior
Principal is null
Configuration
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: