I need a way to put tenant domain info in JWT token (like a claim)?
I've to retrieve it in my java application
I need a way to put tenant domain info in JWT token (like a claim)?
I've to retrieve it in my java application
Believe you are talking about the ID Token
of the OpenID connect
spec.
Easier way to achieve this is to tick the Use tenant domain in local subject identifier
option of your Service Provider application's Local and outbound configurations
section. This will append the tenant domain at the end of the username in the sub
field of the ID token as below. (Your Java application can process that extract the tenant domain)
"sub": "admin@carbon.super"
If you don't like that approach, you might want to write a custom ID token builder extending the default. Defined in the identity.xml file as <IDTokenBuilder>org.wso2.carbon.identity.openidconnect.DefaultIDTokenBuilder</IDTokenBuilder>