This article describes how to assign Okta users to applications using Okta APIs.
- Okta APIs
- User Lifecycle Management
- Rockstar Browser Extension
When assigning a user to an app via API call, the following parameters will be needed:
Method is POST with the following call /api/v1/apps/{appId}/users.
See below a request sample:
curl -i -X POST \
'https://subdomain.okta.com/api/v1/apps/{appId}/users' \
-H 'Authorization: YOUR_AUTH_INFO_HERE' \
-H 'Content-Type: application/json' \
-d '{
"id": "00ud4tVDDXYVKPXKVLCO",
"scope": "USER",
"credentials": {
"userName": "rae.cloud@example.com"
}
}'
This can be done using a third-party tool such as Rockstar or Postman. In the following steps, we will use Rockstar since the API explorer makes this easy.
- Open the application page in Okta.
- Open the Rockstar Browser Extension and click on the API Explorer.
- Select Post and from the dropdown
/api/v1/apps/${appId}/users. Fill in the body with the following request example, like below:
{
"id": "00ur4avh58WRo4O9i417",
"scope": "USER",
"credentials": {
"userName": "rae.cloud@example.com"
}
}
- Click Send. The response should be Status: 200 success to show the request was completed successfully.
