Assigning Users to Apps Using Okta APIs
Last Updated:
Overview
Assigning users to an application in Okta requires a POST request to /api/v1/apps/{appId}/users with the user ID, scope, and credentials. This can be performed using the Rockstar Browser Extension's API Explorer or another compatible API client tool. Following the steps in this article resolves the assignment.
Applies To
- Okta Identity Engine (OIE)
- Okta Classic Engine
- Okta APIs
- User Lifecycle Management
- Rockstar Browser Extension
Solution
Assigning a User to an Application via the Okta API
Use the POST method to assign a user to an application by sending the required parameters to the Okta API endpoint.
The API call uses the POST method with the following endpoint:
/api/v1/apps/{appId}/users
The following is a request sample:
curl -i -X POST \
'https://subdomain.okta.com/api/v1/apps/{appId}/users' \
-H 'Authorization: AUTH_INFO_HERE' \
-H 'Content-Type: application/json' \
-d '{
"id": "00ud4tVDDXYVKPXKVLCO",
"scope": "USER",
"credentials": {
"userName": "user@example.com"
}
}'
This can be performed using a compatible API client tool (for example, Rockstar or Postman; use the tool that best fits organizational guidelines).
How is the assignment completed using the Rockstar browser extension?
Use the Rockstar Browser Extension's API Explorer to submit the assignment request directly from the application page.
- Open the application page in Okta.
- Open the Rockstar Browser Extension and click API Explorer.
- Choose Post and select
/api/v1/apps/${appId}/usersfrom the dropdown menu. - Fill in the body with the following request example:
{ "id": "00ur4avh58WRo4O9i417", "scope": "USER", "credentials": { "userName": "user@example.com" } }
- Click Send. The response displays Status: 200 success to confirm the request completed successfully.
