0
votes

I wrote a jwt authentication custom handler for WSO2 API manager that I deposited in \wso2\wso2am-2.1.0\repository\components\lib

I declared my custom handler in the configuration file of my API (\wso2am-2.1.0\repository\deployment\server\synapse-configs\default\API\MyAPI.xml), in the section handlers, just before handler "org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticationHandler"

It works.

My problem is that when I go through the publisher site (click on "Save", "Next Manage" or "Next Implement"), my configuration is overwritten and the jwt control is no longer realized.

Is my way correct? Should the custom handler be positioned elsewhere? What is the best practice for setting up a jwt check?

Thank you in advance for your answers

1

1 Answers

0
votes

Did you try to declare your JWT custom implementation inside the identity configuration file?

The identity configuration path is:

~/wso2am-<your_version>/repository/conf/identity/identity.xml

And then you need to add the element IdentityOAuthTokenGenerator inside the OAuth element. like this:

<OAuth>
    <IdentityOAuthTokenGenerator>com.your.package.YourJWTToken</IdentityOAuthTokenGenerator>

Should work.