Complement Token Flow
This flow is executed during the creation of tokens and token introspection.
The flow is represented by the following Ids in the API: 2
Pre Userinfo creation (id_token / userinfo / introspection endpoint)
This trigger is called before userinfo are set in the id_token or userinfo and introspection endpoint response.
The trigger is represented by the following Ids in the API: 4
Parameters of Pre Userinfo creation
ctxThe first parameter contains the following fields:v1claimsClaimsgetUser()UserusergetMetadata()metadataResultgrantsUserGrantList
orggetMetadata()metadataResult
apiThe second parameter contains the following fields:v1userinfoThis function is deprecated, please useapi.v1.claimssetClaim(string, Any)Sets any value if the key is not already present. If it's already present there is a message added tourn:zitadel:iam:action:${action.name}:logNote that keys with prefixurn:zitadel:iamwill be ignored.
claimssetClaim(string, Any)Sets any value if the key is not already present. If it's already present there is a message added tourn:zitadel:iam:action:${action.name}:logNote that keys with prefixurn:zitadel:iamwill be ignored.
usersetMetadata(string, Any)Key of the metadata and any value
Pre access token creation
This trigger is called before the claims are set in the access token and the token type is jwt.
The trigger is represented by the following Ids in the API: 5
Parameters of Pre access token creation
ctxThe first parameter contains the following fields:v1claimsClaimsgetUser()UserusergetMetadata()metadataResultgrantsUserGrantList
orggetMetadata()metadataResult
apiThe second parameter contains the following fields:v1claimssetClaim(string, Any)Sets any value if the key is not already present. If it's already present there is a message added tourn:zitadel:iam:action:${action.name}:logNote that keys with prefixurn:zitadel:iamwill be ignored.appendLogIntoClaims(string)Appends the entry into the claimurn:zitadel:action:{action.name}:logthe value of the claim is an Array of string
usersetMetadata(string, Any)Key of the metadata and any value
Was this page helpful?