WSO2 APIM How to limit user to execute only in sandbox

219 views Asked by At

I want to publish my API, but I want to limit so users can only execute in sandbox environment (I want to limit production to specific user/customers with specific agreement).

This is a basic functionality in other API managers, but I don't find how to do in WSO2.

I have found this article in Medium, and also noticed that when I create an aplication, a couple of new roles are created (Application/user_application_SANDBOX and Application/user_application_PRODUCTION), but I don't find how to use them.

Deep dive in doc doesn't helped me.

1

There are 1 answers

1
Bee On

Option 1:

You can use application registration workflow to control key generation for production and sandbox, by sending it through an approval process.

If you want to automate it based on a property or something, you can write a custom workflow extension.

However, this is applied to applications but not to APIs. That means if you allow generating prod keys for an application, all APIs, that the application has subscribed to, are accessible with prod keys.

Option2:

If you want to do this in API level, you can write a custom mediation sequence. Within the custom sequence, you can read the key type (i.e. production or sandbox), subscriber, enduser (if required) etc. and decide whether you want to allow the request or not.