Reputation: 97
I am trying to explore the JWT feature of WSO2 APIM 3.1.0 which passes specific attributes like enduser/subscriber and application details to the backend from WSO2 API Gateway. I wanted to know where can i find the default JWT generator jar or class: "org.wso2.carbon.apimgt.keymgt.token.JWTGenerator". I checked in the dropins folder under <Product_Home>/repository/components but didn't find.
The default JWT generator class sends details something like below. I want to know, can we customize to send the user/subscriber roles as well along with the below details. Need suggestions about this feature.
{
"http://wso2.org/claims/applicationtier": "Unlimited",
"http://wso2.org/claims/version": "1.0.0",
"http://wso2.org/claims/keytype": "PRODUCTION",
"iss": "wso2.org/products/am",
"http://wso2.org/claims/applicationname": "DefaultApplication",
"keytype": "PRODUCTION",
"http://wso2.org/claims/enduser": "[email protected]",
"http://wso2.org/claims/enduserTenantId": "-1234",
"http://wso2.org/claims/subscriber": "john",
"http://wso2.org/claims/tier": "Unlimited",
"scope": "order_pizza",
"exp": "1597753868867",
"http://wso2.org/claims/applicationid": "4",
"http://wso2.org/claims/usertype": "Application_User",
"consumerKey": "e5syg4saM5hAxDZkUYA1gy2hyy0a",
"http://wso2.org/claims/apicontext": "/pizzashack/1.0.0"
}
Upvotes: 0
Views: 197
Reputation: 1430
You can find info about customising JWTs and passing end-user attributes to backend using JWTs in https://apim.docs.wso2.com/en/latest/learn/api-gateway/passing-end-user-attributes-to-the-backend/passing-enduser-attributes-to-the-backend-using-jwt/#passing-enduser-attributes-to-the-backend-using-jwt .
Upvotes: 1