Federated authentication allows developers to bring features of compatible Platform Services to VR experiences that run on supported non-Meta platforms. Federated apps are enabled to make service requests on behalf of federated users that exist outside the Meta ecosystem. This can be leveraged to provide crossplay between federated apps and primary apps running on Meta devices.
Compatibility
Federated authentication is only available for supported non-Meta platforms and compatible Meta Platform Services.
Federated authentication is available for apps running on the following devices and frameworks:
SteamVR
Windows Mixed Reality VR
Federated Apps
Federated apps are applications that run on supported non-Meta platforms and that have been enabled to access Meta Platform Services as if they were primary apps. Like primary apps, federated apps have unique IDs and app secrets that are needed to generate the access tokens required to authenticate requests to Platform Services APIs.
Federated App Credentials
Federated apps have unique credentials that are required to initialize the Platform Services and create federated user tokens.
Enabling
To enable your app to be federated:
In the left navigation bar of the developer dashboard, click Development > API to select your app.
In the API window to the right, click Generate Federated App ID.
Getting a Federated App Access Token
Requests to some Platform APIs require a federated app access token for authentication.
To get a federated app access token:
In the left navigation bar of the developer dashboard, click Development > API to select your app.
Click Federated App. The federated app access token is located under App Credentials.
Federated Users
Federated users provide non-Meta federated app users with an identity that exists on the Meta platform.
Every federated user has:
An ID that is unique to the developer organization it was created under
A persistent ID which is a unique immutable ID used for federated user indexing
A display name which can be displayed in a federated app
A unique name given to a federated user if their display name is already taken by another user, formatted {display_name}# followed by a numerical ID
Most federated authorization APIs require some of the data above in either the path or query. Several APIs pass back a data object containing the information above, which can be used to obtain the required data.
Generating a User Token
To generate a federated user token:
If you are creating a new federated user, call federated_user_create specifying a unique persistent ID.
For an existing federated user, call one of the read user APIs.
Retrieve the persistent ID from the persistent_id field in the JSON response payload.
Call federated_user_gen_access_token with the query parameter persistent_id set to the ID you obtained in the previous step. The federated user token is provided in the response.
User Test Tokens
Test access tokens for federated users can be generated in the developer dashboard:
In the left navigation bar of the developer dashboard, click Development > API to select your app.
Click Federated App.
Click Generate Token.
Use cases of federated authentication
Here is a step-by-step guide on how to use federated authentication with Meta Avatars.
The process involves enabling the app to be federated, obtaining an access token for the app, and then obtaining a federated user access token. Finally, the obtained access token is used to initialize the Meta Avatars SDK.