Sign In With Roboflow (Getting Started)
Let users sign in to your application with their Roboflow account using OAuth 2.1 and PKCE.
You can let users sign in to your application with their Roboflow account, using the OAuth 2.1 authorization code flow with PKCE. Your app then acts for that user, limited to the permissions they approve.
OAuth access tokens work on api.roboflow.com with Authorization: Bearer. See Authenticate with the REST API for details.
For hosts, visibility, errors, and a runnable sample app, see Sign In With Roboflow (Developer Reference).
Create an OAuth App
To register your application:
Open Developer Settings
Go to "Workspace Settings > Developer" in your Roboflow dashboard at app.roboflow.com.

Create a new OAuth app
Click "Create OAuth App" (or "New app") and fill in:
Name
Display name on the consent screen and in your OAuth apps list.
Homepage URL
Your product URL. Shown on the consent screen for information.
Redirect URIs
One or more callback URLs. Each must match the redirect_uri your code sends exactly.
Token endpoint authentication
How your app sends its secret to the token endpoint: client_secret_post (in the request body, the default) or client_secret_basic (in an HTTP Basic Authorization header). Most MCP gateways (ex: Azure, TrueFoundry) use client_secret_basic.
Allowed scopes
Every scope you will request at sign-in.
Visibility
Internal, Unlisted, or Public. See Visibility.


You get a Client ID and a Client Secret (rfcs_…). The secret is shown only once, so store it on your server.
Redirect URI Examples
http://localhost:3001/oauth/callback
Local development on port 3001
http://127.0.0.1:3001/oauth/callback
The same, if your app uses 127.0.0.1
https://yourapp.com/oauth/callback
Production
Public hosts need HTTPS. HTTP works only for loopback addresses (localhost, 127.0.0.1, ::1).
Authorization Flow
Roboflow uses the authorization code grant with PKCE (Proof Key for Code Exchange). Every client must use PKCE with the S256 method.
Generate a PKCE code verifier and challenge
Create a random code_verifier (43 to 128 characters) and derive a code_challenge from it with SHA-256:
import hashlib, base64, secrets
code_verifier = secrets.token_urlsafe(32)
code_challenge = base64.urlsafe_b64encode(
hashlib.sha256(code_verifier.encode()).digest()
).rstrip(b"=").decode()Redirect the user to authorize
Send the user's browser to the Roboflow authorization URL:
https://app.roboflow.com/oauth/authorize?
client_id=YOUR_CLIENT_ID&
redirect_uri=https://yourapp.com/callback&
response_type=code&
scope=openid profile email workspace:read&
code_challenge=YOUR_CODE_CHALLENGE&
code_challenge_method=S256&
state=YOUR_STATE_VALUEUse a random state value and check it on the callback. Roboflow does not require state, but your app needs it to block forged callbacks. Keep code_verifier on your server until you exchange the code.
The user sees a consent screen with the permissions your app asked for, and picks the workspace to grant.

After they approve, Roboflow redirects to your redirect_uri with code and state.
Exchange the code for tokens
On your server (never in the browser), send the code and your code_verifier to the token endpoint with grant_type=authorization_code. The code is single use and expires after 60 seconds, so exchange it right away. See Get or Refresh Tokens.
Tokens
Get or Refresh Tokens
The token endpoint handles both the code exchange and refreshes. Send grant_type=authorization_code with the code from the callback, or grant_type=refresh_token with a refresh token.
An access token lasts 1 hour (24 hours for MCP clients) and a refresh token 30 days. When the access token expires, refresh it. If the refresh fails with invalid_grant, send the user through sign-in again.
Exchanges an authorization code for tokens (grant_type=authorization_code), or a refresh token for a new access token (grant_type=refresh_token). Call it from your server, never from the browser. Workspace OAuth apps authenticate with their client secret, in the body (client_secret_post, the default) or in an HTTP Basic header (client_secret_basic), whichever the app is set to. Public MCP clients send only client_id and rely on PKCE. Rate limited per IP address.
client_secret_basic: your client ID as the username and client secret as the password. Use it only when your OAuth app is set to client_secret_basic. Otherwise send client_id and client_secret in the form body.
Tokens issued.
Opaque rfoa_ token for api.roboflow.com, sent as Authorization: Bearer. It is bound to the workspace the user picked on the consent screen.
Seconds until the access token expires: 3600 (1 hour), or 86400 (24 hours) for MCP clients.
rfor_ token for grant_type=refresh_token. Valid for 30 days. A refresh can return a new refresh token once the current one nears expiry: always store the value from the latest response.
Signed RS256 JWT with identity claims. Only returned when openid was granted. Verify it with the JWKS at /.well-known/jwks.json.
Space-separated scopes the access token carries.
The request failed. error is invalid_request (ex: a missing or wrong code_verifier, a redirect_uri that does not match), invalid_grant (the code or refresh token is expired, already used or revoked, or the workspace no longer allows the app), invalid_scope, or unsupported_grant_type.
invalid_client: the client_id is unknown or the client secret is wrong or sent the wrong way.
Too many token requests from this IP address.
POST /oauth/token HTTP/1.1
Host: app.roboflow.com
Authorization: Basic username:password
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 243
"grant_type='text'&code='rfoc_Qm9ndXNDb2RlRXhhbXBsZQ'&redirect_uri='https://yourapp.com/oauth/callback'&code_verifier='dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk'&client_id='YOUR_CLIENT_ID'&client_secret='rfcs_YOUR_CLIENT_SECRET'"{
"access_token": "rfoa_QWNjZXNzVG9rZW5FeGFtcGxl",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "rfor_UmVmcmVzaFRva2VuRXhhbXBsZQ",
"id_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"scope": "openid profile email workspace:read"
}Use an Access Token
Send the access token in the Authorization header on api.roboflow.com:
Validate a Token
Checks an access token's status and expiry without client credentials. Resource servers that receive rfoa_ tokens (ex: an MCP server) use it to cache a token until it expires.
Checks an rfoa_ access token without client credentials: the token authenticates itself. A well-formed request always returns 200, and a dead token reports active false, so you can tell a dead token from an unreachable server. Cache the result until exp.
An rfoa_ OAuth access token.
The token's state.
True when the token is live. When false, every other field is null or empty.
Expiry time in seconds since the Unix epoch.
URL slug of the workspace the token is bound to.
Id of that workspace.
The Roboflow user the token acts for.
Scopes granted when the user consented. Use it only to rule a request out early.
Scopes the token carries now. Authoritative: a scope can be removed before the token expires.
invalid_request: no Bearer token in the Authorization header.
Too many requests.
GET /oauth/validate HTTP/1.1
Host: app.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"active": true,
"exp": 1893456000,
"workspace_url": "your-workspace",
"workspace_id": "5f3Tq8k2ZbW1aXyZ",
"user_id": "user_abc123",
"granted_scopes": [
"workspace:read",
"project:read"
],
"scopes": [
"workspace:read",
"project:read"
]
}Revoke a Token
Revokes an access token or a refresh token. Call it when the user signs out of your app.
Revokes an access token or a refresh token (RFC 7009). The client authenticates the same way as on the token endpoint. Call it when the user signs out. Rate limited per IP address.
client_secret_basic: your client ID as the username and client secret as the password. Use it only when your OAuth app is set to client_secret_basic. Otherwise send client_id and client_secret in the form body.
An rfoa_ access token or rfor_ refresh token.
rfoa_QWNjZXNzVG9rZW5FeGFtcGxlWhich kind of token you are sending. Optional.
Your client ID. Required unless you send it in the HTTP Basic header.
YOUR_CLIENT_IDYour client secret, for apps set to client_secret_post.
rfcs_YOUR_CLIENT_SECRETThe token is revoked. The body is empty. An unknown or already revoked token also returns 200.
No content
invalid_request: the token parameter is missing.
invalid_client: the client is unknown or its secret is wrong.
Too many requests from this IP address.
POST /oauth/revoke HTTP/1.1
Host: app.roboflow.com
Authorization: Basic username:password
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 145
"token='rfoa_QWNjZXNzVG9rZW5FeGFtcGxl'&token_type_hint='access_token'&client_id='YOUR_CLIENT_ID'&client_secret='rfcs_YOUR_CLIENT_SECRET'"No content
Get User Info
Returns the signed-in user's profile. The token needs the openid scope.
Returns the signed-in user's identity claims (OpenID Connect UserInfo). The access token must carry the openid scope. Add profile for name and email, or email for email alone.
An rfoa_ OAuth access token.
The user's claims.
Stable Roboflow user id.
Display name. Requires profile.
Email address. Requires email or profile.
invalid_token: the access token is missing, expired or revoked.
insufficient_scope: the access token does not carry openid.
GET /oauth/userinfo HTTP/1.1
Host: app.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"sub": "user_abc123",
"name": "Ada Lovelace",
"email": "ada@example.com"
}Available Scopes
Your app can request any combination of these scopes. Each one must also be on your OAuth app's "Allowed scopes" list.
Identity Scopes
openid
Returns a stable user ID in the sub claim. Needed for an id_token and for user info.
profile
Read the user's display name and email address.
email
Read the user's email address.
API Scopes
workspace:read
Read workspace details, list projects
project:create
Create projects
project:read
Read project details
project:update
Update project settings
image:create
Upload images
image:read
Read and download images
image:tag
Add and remove image tags
image:annotate
Create and update annotations
model:infer
Run inference
model:deploy
Deploy models
model:manage
Manage model settings
model-eval:read
Read model evaluation results
workflow:create
Create Workflows
workflow:read
Read Workflows
workflow:update
Update Workflows
version:create
Create dataset versions
version:read
Read dataset versions
version:update
Update dataset versions
training-job:create
Start training jobs
folder:create
Create project folders
folder:read
Read project folders
folder:update
Update project folders
folder:delete
Delete project folders
OIDC Discovery
Roboflow publishes standard OpenID Connect discovery documents. OAuth and OIDC client libraries read them to find the endpoints above.
OpenID Configuration:
https://app.roboflow.com/.well-known/openid-configurationJWKS, for verifying ID tokens:
https://app.roboflow.com/.well-known/jwks.json
Next Steps
Sign In With Roboflow (Developer Reference): hosts, visibility, errors, example app
Last updated
Was this helpful?