0D5WR00002NPFNc0APOkta Classic EngineAuthenticationUnanswered2026-11-02T06:32:34.000Z2026-11-02T06:32:34.000Z

JoeM.36848 (Customer) asked a question.

Custom ID token claim set to "Userinfo / id_token request" still included in ID token (Authorization Code + PKCE, Identity Engine)

I'm trying to return a custom claim only from /userinfo and keep it out of the ID token, using a custom authorization server in an Identity Engine org.

 

Docs say this should work

 

Create API access claims (https://help.okta.com/oie/en-us/content/topics/security/api-config-claims.htm):

  • ID token claims are dynamic. By default, the authorization server doesn't include them in the ID token when requested with an access token or authorization code. To keep this default, select Userinfo/id_token request for Include in token type… If the claim isn't included, the client must use an access token to get the claims from the UserInfo endpoint.

 

Authorization Server Claims API (https://developer.okta.com/docs/api/openapi/okta-management/management/tag/AuthorizationServerClaims) (alwaysIncludeInToken):

  • If the value is set to FALSE for an ID token claim, the Claim isn't included in the ID token when the token is requested with the access token or with the authorization_code.

 

OpenID Connect & OAuth 2.0 overview (https://developer.okta.com/docs/api/openapi/okta-oauth/guides/overview):

  • The /userinfo endpoint always contains a full set of claims for the requested scopes.

 

Setup

- Custom authorization server: default

- Custom scope: pii

- Custom claim: pii_claim

 - Include in token type: ID Token, Userinfo / id_token request

 - Value: user.email

 - Include in: scope pii

- App: SPA, Authorization Code + PKCE (okta-auth-js 7.14), Implicit not enabled

- Requested scopes: openid pii

 

Expected: pii_claim is absent from the ID token and returned by /userinfo.

 

Actual: pii_claim is present in both the ID token and /userinfo.

 

Already ruled out

- response_type is code (confirmed in the System Log app.oauth2.as.authorize event)

- An access token is issued alongside the ID token (the ID token contains at_hash)

- Only one claim definition named pii_claim exists; it isn't set to "Always"

- The issuer is the custom server (…/oauth2/default), not the org authorization server

- Token Preview (grant type Authorization Code, scopes openid pii) also shows pii_claim in the ID token, so it isn't client-side

 

Questions

1. Is this expected on Identity Engine, or a defect?

2. If expected, what's the supported way to return a claim only from /userinfo? Is a token inline hook removing it from the ID token the only option?


Recommended content

No recommended content found...