Skip to content

[Accelerator 4] Access token attributes cannot be added from IS console UI #887

@imesh94

Description

@imesh94

We have written FSDefaultOIDCClaimsCallbackHandler [1] extending DefaultOIDCClaimsCallbackHandler to add consent_id as a jwt access token claim. To engage this, we are setting enable_claims_separation_for_access_tokens = false in IS deployment.toml.

However, this overrides the default behavior in IS, because

  1. Access token claims cannot be added when enable_claims_separation_for_access_tokens is set to false. This is due to the logic at [2], where this configuration is checked before updating the access token claims.

  2. When enable_claims_separation_for_access_tokensis set to false, IS defaultJWTAccessTokenOIDCClaimsHandler` is not engaged. This is due to the logic at [3], where it decides which claims handler to engaged based on the config.

Proposed Solution: Instead of using FSDefaultOIDCClaimsCallbackHandler, a JWTAccessTokenClaimProvider [4] can be added to set consent_id as a jwt access token claim. If we follow this approach, there is no need to set `enable_claims_separation_for_access_tokens' as false, and IS default behavior will be preserved.

OB Internal Ticket: https://github.com/wso2-enterprise/wso2-ob-internal/issues/1281

[1] - https://github.com/wso2/financial-services-accelerator/blob/v4.1.1/financial-services-accelerator/components/org.wso2.financial.services.accelerator.identity.extensions/src/main/java/org/wso2/financial/services/accelerator/identity/extensions/claims/FSDefaultOIDCClaimsCallbackHandler.java

[2] - https://github.com/wso2-extensions/identity-inbound-auth-oauth/blob/v7.1.10/components/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth/OAuthAdminServiceImpl.java#L1014

[3] - https://github.com/wso2-extensions/identity-inbound-auth-oauth/blob/v7.1.10/components/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/openidconnect/util/ClaimHandlerUtil.java#L51

[4] - https://github.com/wso2-extensions/identity-inbound-auth-oauth/blob/v7.1.10/components/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth2/token/handlers/claims/JWTAccessTokenClaimProvider.java

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions