Enhancing API Security with Auth0 and WSO2 API Manager
Introduction
WSO2 API Manager 4.0.0 allows you to secure and manage APIs efficiently. Integrating a third-party key manager like Auth0 enables external token issuance and centralized authentication for your APIs.
Description
By connecting WSO2 API Manager with Auth0, you can use Auth0-issued oauth to access your APIs, ensuring secure, scalable, and centralized identity management. This blog explains how to configure Auth0 as a key manager, generate tokens, and securely access WSO2 APIs.
Prerequisites
Before we start, ensure you have the following:
WSO2 API Manager 4.0.0 installed locally
Windows: api-manager.bat
MacOS/Linux: sh api-manager.sh
Auth0 Account
Step 1: Create an Application in Auth0
Your Auth0 application is now ready.
Step 2: Create an API in Auth0
Your Auth0 API is now created and ready to issue JWT tokens.
Step 3: Configure Auth0 as a Key Manager in WSO2
https://<your-domain>.us.auth0.com/.well-known/openid-configuration
4. Grant Type: client_credentials
5. Certificates File (JWKS URL):
Recommended by LinkedIn
https://<your-domain>.us.auth0.com/.well-known/jwks.json
6. Connector Configurations:
7. Click Save.
Auth0 is now successfully configured as a key manager in WSO2.
Step 4: Apply Policy and Generate Access Token
4. Subscribe the API to the Application:
5. Generate Production Keys:
Under Prod Keys, select RESIDENT KEY MANAGER key manager
6. Generate Access Token:
Scroll up → Click CURL To Generate Access Token
Step 5: Test the API
3. Hit the endpoint:
Sequence Diagram:
Snippets of this entire process: