
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?

Hello @JoeM.36848 (Customer) Thank you for posting on our Community page!
You are asking how to configure a Custom Claim in a custom Authorization Server (default) on Identity Engine so that the claim pii_claim is returned only from the /userinfo endpoint and is absent from the ID token, and whether a Token Inline Hook is the only way to achieve this.
Summary: The claim's ID token inclusion is controlled by the claim's alwaysIncludeInToken setting, so the first step is to confirm that setting is saved as false, and if it is, the claim should be removed from the ID token; if the claim still appears, that needs verification through Okta Support.
Root Cause: The ID token contents for a custom claim depend on the claim's "Include in token type" setting. When that setting is "Userinfo/id_token request" (alwaysIncludeInToken=false), the claim is supposed to be left out of the ID token for an authorization code request, and the client is expected to retrieve it from /userinfo. Because pii_claim still appears in the ID token and in the Token Preview, the saved configuration does not match what the server issues, and this needs to be verified against the org.
Solution: Follow these steps:
Thank you for reaching out to our Community and have a great day!
--
Help others in the community by liking or hitting Select as Best if this response helped you.