WSO2 API Authentication for multiple users

61 Views Asked by At

I need to add multiple credentials for one API in wso2 MI. How to achieve this?

1

There are 1 best solutions below

0
ycr On

If you want to allow a selected set of users to access an API you may have to use role-based authorization. Where you can create a role in MI and assign this role to the users you wish to give access to, then white list this role in the API. For this, you can use this Custom Handler and engage it like shown below.

<handler class="com.ycr.auth.handlers.AuthorizationHandler">
      <property name="roles" value="admin,test" />
      <property name="authorize" value="true" />
</handler>

You can read more on this here.