OAuth connect setup_
Register an OAuth app and implement the authorization code flow to connect your platform to user Appwrite accounts.
2 min read
Register an OAuth app
- Open your organization in the Appwrite Console
- Go to Settings > OAuth apps
- Create an app with your platform name and redirect URIs
- Copy the client ID and client secret to your server environment
Redirect URIs must match exactly what your backend uses to receive the authorization code.
Authorization flow
- Send the user to Appwrite's authorize URL with
client_id,redirect_uri,response_type=code, andscope - User signs in and approves the requested scopes
- Appwrite redirects back with an authorization
code - Your server exchanges the code for tokens using the token endpoint and your client secret
- Store refresh tokens securely and use access tokens for Console API calls
Call the API with a user token
After the token exchange, set the access token as a bearer token. Pass the organization the user selected, the same way a Partners key does.
Refresh access tokens before they expire using the refresh token Appwrite returned during exchange.
Production checklist
- Use HTTPS redirect URIs only
- Validate
stateto prevent CSRF - Store client secret and refresh tokens in a secrets manager
- Request the minimum scopes from OAuth scopes
- Handle revocation when users disconnect your integration
Was this page helpful?
Share what worked or what we should fix. Once approved, our agents automatically apply suggested updates to the docs.