This repository contains a sample custom JWT transformer for WSO2 API Manager (APIM) version 4.1.0. The transformer modifies incoming JWT roles claim as needed, specifically converting the roles claim from an array to a string if the token's issuer is http://localhost:8080/realms/master.
Example Transformation If the incoming JWT contains the following roles claim:
"roles": [
"default-roles-master",
"offline_access",
"uma_authorization"
]
The transformer will convert it to:
"roles": "default-roles-master offline_access uma_authorization"
This repository serves as an example, and you can customize the transformer to modify any claims as per your requirements.
- WSO2 API Manager 4.1.0
- Maven build tool
Build the Project Use Maven to build the project:
mvn clean install
After building, locate the generated JAR file in the target folder. Copy the JAR file to the:
<API-M_HOME>/repository/components/dropins directory
Restart the WSO2 API Manager to apply the changes.