Using Auth0 as an IdP¶
Follow the instructions below to use Auth0 as the Identity Provider (IdP) to authenticate the APIs that belong to a specific Organization:
Step 1 - Create an Organization¶
Create an organization in Auth0.
For testing purposes let's create an organization named org1.
Step 2 - Create a user¶
If you have not created the user already, create a user.
Step 3 - Assign the user to the organization¶
Assign the member to the Organization, which you created in Step 1.
Step 4 - Enable a connection¶
Add a connection for your organization as Username-Password-Authentication.
Step 5 - Create an application¶
-
Let's create an application as
My App. -
Configure the application.
Configure the organization settings that correspond to the application.
- Define the type of users that will log in to this application -
Individuals
- Define the type of users that will log in to this application -
Step 6 - Update the Helm Chart¶
- Access the endpoints that correspond to the application, which is available in the Advanced Settings section.
- Follow the instructions outlined in Customize Configurations. These instructions will guide you through the process of acquiring the
values.yamlfile. Open thevalues.yamlfile. - Update the IDP related configurations in the
idpsection. -
Create a K8s Secret with retrieved
clientIdandclientSecretfrom Step 4 with nameapk-idp-secret.idp: issuer: "" jwksEndpoint: "" usernameClaim: "" organizationClaim: ""organizationClaim- This should always beorg_id.- Update all other values based on the Endpoint details that you came across in Step 6.1.
Step 7 - Restart WSO2 APK¶
helm install <helm-chart-name> .
helm install apk-test .
Step 8 - Generate an Access Token¶
- Open Postman and create a new request to generate the auth code token.
- Navigate to the Authorization tab of the request.
-
Make sure that the token generation call has the same information that was entered in the Helm Chart in Step 6.
Auth URLAccess Token URLClient IDClient SecretUsernamePasswordCallBack UrlScopes - (rest API related scopes + openid)
-
Click Get New Access Token.
- You will receive two tokens, namely the access token and ID token, when the token call is successful.
- Copy the ID token that you see listed as the
id_token.
Step 9 - Invoke the System API¶
Use the JWT token that you received in the previous step to invoke the system APIs.