How OAuth clients work
The flow is:- Create an OAuth client for the project.
- Send the user through that OAuth flow from your app.
- After sign-in, your backend decides which rooms the user should access.
- Your backend mints participant tokens for those rooms.
- Your app connects to the room with that token.
Set up an OAuth client
Use MeshAgent Studio for the main UI flow.- Open OAuth Clients in your project.
- Create a new client.
- Enter a name for the app.
- Add one or more redirect URIs.
- Choose the grant types and response types your app uses.
- Set the scopes your app should request.
- Save the client and copy the client ID and client secret.
What the fields mean
- Name: a label for the app in MeshAgent Studio
- Redirect URIs: the callback URLs MeshAgent can send users back to after sign-in
- Grant types: the OAuth flows your app is allowed to use, such as
authorization_code,refresh_token, orclient_credentials - Response types: the response formats your app expects from the OAuth flow, such as
code,token, orid_token - Scopes: the scopes returned in tokens for this client, such as
openid profile email offline_access
authorization_code, you need at least one redirect URI.
Typical setup
For a typical app with a backend:- use
authorization_code - add
refresh_tokenif you want long-lived sign-in sessions - add your callback URL as a redirect URI
- request the scopes your app actually needs
REST API and SDKs
Use the REST API or SDKs when you want to provision clients programmatically. OAuth clients live under the project:POST /accounts/projects/{project_id}/oauth/clientsGET /accounts/projects/{project_id}/oauth/clientsPUT /accounts/projects/{project_id}/oauth/clients/{client_id}DELETE /accounts/projects/{project_id}/oauth/clients/{client_id}