Integration with Okta
This how-to helps you get up and running by integrating the OneWelcome Identity Platform with Okta.
Okta is a solution to add authentication and authorization services to your applications. It can be connected with the identity provider of your choice and can be extended with other applications. The OneWelcome Identity Platform provides an extension to Okta that enables the enrichment of its access tokens with a claim based on your users' relationships (see Relationship-based Access Control). All you need to do is to set up an Okta inline hook.
How to set up the Okta inline hook?
Okta setup
Step 1. Create an inline hook
-
Log in to your Okta account.
-
Go to Workflow > Inline Hooks.
-
Click Add Inline Hook and select Token from the drop-down menu.
-
Enter the following values:
Field Name Value Description Name ReBAC
URL https://hooks.scaledaccess.com/{tenant}/okta
Your tenant code provided by the OneWelcome Identity Platform. This code can be found in manage.scaledaccess.com after your sandbox environment is set up. Authentication field apiKey
Authentication secret The API key connected to your OneWelcome Identity Platform tenant. Create and use the API key for your tenant (see set up webhook configuration) -
Click Save.
Step 2. Activate the inline hook
- Go to Security > API.
- Select the default authorization server.
- Click Edit.
- Go to the Access Policies tab.
- For the Default Policy, edit the Default Policy Rule by clicking the pencil icon.
- In the Use this inline hook field, select ReBAC from the drop-down menu.
- Click Update Rule.
Obtaining and using an enriched access token
Step 3. Request an Okta access token
- Use your regular method to request an access token.
- Confirm that the access token contains the
scaledaccess_relationships
claim (for example, by copying the token into jwt.io). If the user has no relationships (yet), the array will be empty.
Step 4. Make access decisions based on relationships
- Use the enriched access token to access a protected resource at your API service.
- The API service must provide a mechanism to grant or deny access based on the
scaledaccess_relationships
claim.
Testing token enrichment in Postman
This how-to gives detailed instructions on how to use Postman to obtain an Okta access token enriched with the relationships of the authenticated user.
Okta setup
Make sure to first complete the instructions in how to set up the Okta inline hook.
Step 1. Create a demo application
- Log in to your Okta account.
- Go to Applications > Applications and click Add Application.
- Click Create New App.
- Select Native Service from the Platform drop-down menu.
- Click Create.
- Name your application, such as OneWelcome Demo.
- Click Add URI and enter a dummy URL, such as http://localhost.
- Click Save.
- Edit the General Settings in the General tab:
- In the Allowed grant types field, select the Resource Owner Password check box.
- Click Save.
Step 2. Assign the demo application to a test user
- Go to Directory > People.
- Create a test user:
- Click Add Person.
- Fill in the form. (For a test user, we recommend selecting Set by admin from the Password drop-down menu, and deselecting User must change password on first login.)
- Click Save.
- Select the test user.
- Click Assign Applications.
- Click Assign next to OneWelcome Demo.
- Click Save and Go Back.
- Click Done.
Obtaining an enriched access token in Postman
Step 3. Request an Okta access token
- Start a new request in Postman.
- Select POST and enter
{issuer_uri}/v1/token
in the URL field. The Issuer URI for the default Authorization Server can be found in the Security > API page. - Go to the Body tab and select
x-www-form-urlencoded
. -
Enter the key-value pairs:
Key Value grant_type
password
scope
openid
client_id
The client ID* of the OneWelcome Demo application. username
The username of the user in step 2. password
The password of the user in step 2. *The client credentials can be found by selecting the OneWelcome Demo in the Applications > Applications page.
-
Click Send.
Step 4. Check the enriched token
- Copy the access token in the response.
- Paste the token in jwt.io.
- Confirm that the token contains the
scaledaccess_relationships
claim. If the user has no relationships (yet), the array will be empty.