Roboflow के साथ साइन इन करें (शुरूआत)
उपयोगकर्ताओं को OAuth 2.1 और PKCE का उपयोग करके अपने Roboflow खाते से आपके application में साइन इन करने दें।
आप उपयोगकर्ताओं को OAuth 2.1 authorization code flow with PKCE का उपयोग करके, उनके Roboflow खाते से अपनी application में साइन इन करने दे सकते हैं। फिर आपका app उस उपयोगकर्ता की ओर से कार्य करता है, केवल उन्हीं अनुमतियों तक सीमित जो वे अनुमोदित करते हैं।
OAuth access tokens काम करते हैं api.roboflow.com के साथ Authorization: Bearer. देखें REST API के साथ प्रमाणीकरण करें विवरण के लिए।
होस्ट, दृश्यता, त्रुटियों, और एक चलाने योग्य सैंपल ऐप के लिए देखें Roboflow के साथ साइन इन करें (डेवलपर संदर्भ).
एक OAuth App बनाएं
अपनी application पंजीकृत करने के लिए:
डेवलपर सेटिंग्स खोलें
अपने Roboflow dashboard में "Workspace Settings > Developer" पर जाएँ, यहाँ app.roboflow.com.

एक नया OAuth app बनाएं
"Create OAuth App" (या "New app") पर क्लिक करें और यह भरें:
नाम
सहमति स्क्रीन पर और आपकी OAuth apps सूची में प्रदर्शित नाम।
Homepage URL
आपका product URL। जानकारी के लिए consent screen पर दिखाया जाता है।
Redirect URIs
एक या अधिक callback URLs। प्रत्येक को redirect_uri के साथ ठीक-ठीक मेल खाना चाहिए, जैसा आपका code भेजता है।
Token endpoint authentication
आपका app अपना secret token endpoint को कैसे भेजता है: client_secret_post (request body में, डिफ़ॉल्ट) या client_secret_basic (HTTP Basic में Authorization header)। अधिकांश MCP gateways (जैसे: Azure, TrueFoundry) उपयोग करते हैं client_secret_basic.
Allowed scopes
हर scope जिसे आप sign-in पर अनुरोध करेंगे।
दृश्यता
Internal, Unlisted, या Public। देखें दृश्यता.


आपको एक Client ID और एक Client Secret मिलता है (rfcs_… ). secret केवल एक बार दिखाया जाता है, इसलिए इसे अपने server पर सहेजें।
Redirect URI के उदाहरण
http://localhost:3001/oauth/callback
port 3001 पर local development
http://127.0.0.1:3001/oauth/callback
वही, यदि आपका app इसका उपयोग करता है 127.0.0.1
https://yourapp.com/oauth/callback
उत्पादन
Public hosts के लिए HTTPS आवश्यक है। HTTP केवल loopback addresses पर काम करता है (localhost, 127.0.0.1, ::1).
Authorization Flow
Roboflow authorization code grant के साथ PKCE (Proof Key for Code Exchange) का उपयोग करता है। प्रत्येक client को S256 विधि के साथ PKCE का उपयोग करना होगा।
एक PKCE code verifier और challenge उत्पन्न करें
एक यादृच्छिक बनाएं code_verifier (43 से 128 वर्ण) और इससे एक code_challenge 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()उपयोगकर्ता को अनुमति देने के लिए रीडायरेक्ट करें
उपयोगकर्ता के ब्राउज़र को 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_VALUEएक यादृच्छिक state मान का उपयोग करें और callback पर जाँचें। Roboflow इसकी आवश्यकता नहीं रखता stateलेकिन आपके ऐप को नकली callback को रोकने के लिए इसकी आवश्यकता होती है। रखें code_verifier कोड का आदान-प्रदान करने तक अपने server पर रखें।
उपयोगकर्ता को एक consent screen दिखाई देती है जिसमें आपके app द्वारा माँगी गई अनुमतियाँ होती हैं, और वे grant करने के लिए workspace चुनते हैं।

उनके अनुमोदन के बाद, Roboflow आपके redirect_uri के साथ कोड और state.
कोड को टोकन से बदलें
अपने server पर (कभी भी browser में नहीं), code और अपना code_verifier को token endpoint पर भेजें, साथ में grant_type=authorization_code. code एक बार उपयोग होने वाला है और 60 सेकंड के बाद समाप्त हो जाता है, इसलिए इसे तुरंत exchange करें। देखें टोकन प्राप्त करें या रीफ़्रेश करें.
टोकन
टोकन प्राप्त करें या रीफ़्रेश करें
token endpoint code exchange और refreshes दोनों को संभालता है। भेजें grant_type=authorization_code callback से प्राप्त code के साथ, या grant_type=refresh_token एक refresh token के साथ।
एक access token 1 घंटा (MCP clients के लिए 24 घंटे) और एक refresh token 30 दिन तक रहता है। जब access token समाप्त हो जाए, तो इसे refresh करें। यदि refresh विफल हो invalid_grantके साथ, उपयोगकर्ता को फिर से sign-in कराएँ।
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"
}एक Access Token का उपयोग करें
access token को Authorization header में भेजें api.roboflow.com:
एक Token सत्यापित करें
client credentials के बिना एक access token की स्थिति और expiry जाँचता है। जो resource servers rfoa_ tokens (जैसे: एक MCP server) प्राप्त करते हैं, वे समाप्त होने तक token को cache करने के लिए इसका उपयोग करते हैं।
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"
]
}एक Token रद्द करें
एक access token या एक refresh token को रद्द करता है। जब उपयोगकर्ता आपके app से sign out करे, तब इसे कॉल करें।
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
User Info प्राप्त करें
साइन इन किए हुए उपयोगकर्ता की profile लौटाता है। token को 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"
}उपलब्ध Scopes
आपका app इन scopes के किसी भी संयोजन का अनुरोध कर सकता है। प्रत्येक को आपकी OAuth app की "Allowed scopes" सूची में भी होना चाहिए।
Identity Scopes
openid
में एक स्थिर user ID लौटाता है sub claim। एक id_token और user info के लिए आवश्यक।
profile
उपयोगकर्ता का display name और email address पढ़ें।
email
उपयोगकर्ता का email address पढ़ें।
API Scopes
workspace:read
workspace विवरण पढ़ें, projects सूचीबद्ध करें
project:create
projects बनाएं
project:read
project विवरण पढ़ें
project:update
project settings अपडेट करें
image:create
images अपलोड करें
image:read
images पढ़ें और डाउनलोड करें
image:tag
image tags जोड़ें और हटाएँ
image:annotate
annotations बनाएं और अपडेट करें
model:infer
inference चलाएँ
model:deploy
models deploy करें
model:manage
model settings प्रबंधित करें
model-eval:read
model evaluation परिणाम पढ़ें
workflow:create
Workflows बनाएं
workflow:read
Workflows पढ़ें
workflow:update
Workflows अपडेट करें
version:create
dataset versions बनाएं
version:read
dataset versions पढ़ें
version:update
dataset versions अपडेट करें
training-job:create
training jobs शुरू करें
folder:create
project folders बनाएं
folder:read
project folders पढ़ें
folder:update
project folders अपडेट करें
folder:delete
project folders हटाएँ
OIDC Discovery
Roboflow मानक OpenID Connect discovery documents प्रकाशित करता है। OAuth और OIDC client libraries ऊपर दिए गए endpoints खोजने के लिए उन्हें पढ़ती हैं।
OpenID Configuration:
https://app.roboflow.com/.well-known/openid-configurationID tokens सत्यापित करने के लिए JWKS:
https://app.roboflow.com/.well-known/jwks.json
अगले चरण
Roboflow के साथ साइन इन करें (डेवलपर संदर्भ): होस्ट, दृश्यता, त्रुटियाँ, उदाहरण ऐप
अंतिम अपडेट
क्या यह उपयोगी था?