Develop

Generate Federated User Access Token API

Updated: Oct 21, 2026
Call this endpoint from your server to get a user access token for a federated user. A federated app uses that token to call Platform Services on the user’s behalf.

Prerequisites

  • A federated app. Generate its ID and get its credentials as described in Federated Apps. An access token built from the primary app’s ID and secret is rejected.
  • The user’s persistent ID. You set it when you create a federated user. For an existing user, request the persistent_id field when you read the user.

Example request

printf 'OC|%s|%s' "$FEDERATED_APP_ID" "$FEDERATED_APP_SECRET" |
  curl -X POST \
    --data-urlencode "access_token@-" \
    --data-urlencode "persistent_id=$PERSISTENT_ID" \
    "https://graph.oculus.com/$FEDERATED_APP_ID/federated_user_gen_access_token/"
The app access token goes to curl through standard input, which keeps the app secret out of the process list.

Generate Federated User Access Token (PERSISTENT ID)

Method

POST

Endpoint

https://graph.oculus.com/{federated_app_id}/federated_user_gen_access_token/

Path Parameters

The following table lists the API’s URL path parameters.
NameDescription
{federated_app_id}
The federated application ID which can be obtained from the Developer Dashboard⁠ API page.

Query Parameters

The following table lists the API’s query parameters.
NameDescriptionOptionalType
persistent_id
A unique immutable ID that is used for federated user indexing.
• From 3-31 characters in length; dashes, underscores, colons and all alphanumeric characters allowed
•Must be unique within the developer organization
 
String
access_token
Bearer token that contains OC|$FEDERATED_APP_ID|$FEDERATED_APP_SECRET
 
String

Response

The following table describes the JSON payload received in the API response.
NameDescriptionOptionalType
access_token
A federated access token for a federated user created under the same developer team as the targeted federated app belongs to.
 
 

Errors

The following conditions will result in errors:
  • A federated app with the specified app ID does not exist.
  • A federated user with the specified persistent ID does not exist.