For the complete documentation index, see llms.txt. This page is also available as Markdown.

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 पंजीकृत करने के लिए:

1

डेवलपर सेटिंग्स खोलें

अपने Roboflow dashboard में "Workspace Settings > Developer" पर जाएँ, यहाँ app.roboflow.com.

Developer settings with OAuth applications
2

एक नया 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। देखें दृश्यता.

OAuth applications list on the Developer page
Create OAuth application form

आपको एक Client ID और एक Client Secret मिलता है (rfcs_… ). secret केवल एक बार दिखाया जाता है, इसलिए इसे अपने server पर सहेजें।

Redirect URI के उदाहरण

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 का उपयोग करना होगा।

1

एक 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()
2

उपयोगकर्ता को अनुमति देने के लिए रीडायरेक्ट करें

उपयोगकर्ता के ब्राउज़र को 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 चुनते हैं।

OAuth consent screen with workspace selection and scopes

उनके अनुमोदन के बाद, Roboflow आपके redirect_uri के साथ कोड और state.

3

कोड को टोकन से बदलें

अपने 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 कराएँ।

Get or refresh tokens

post

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.

Authorizations
AuthorizationstringOptional

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.

Body
or
Responses
200

Tokens issued.

application/json
access_tokenstringRequired

Opaque rfoa_ token for api.roboflow.com, sent as Authorization: Bearer. It is bound to the workspace the user picked on the consent screen.

token_typeconst: BearerRequired
expires_inintegerRequired

Seconds until the access token expires: 3600 (1 hour), or 86400 (24 hours) for MCP clients.

refresh_tokenstringOptional

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.

id_tokenstringOptional

Signed RS256 JWT with identity claims. Only returned when openid was granted. Verify it with the JWKS at /.well-known/jwks.json.

scopestringOptional

Space-separated scopes the access token carries.

post/oauth/token
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 करने के लिए इसका उपयोग करते हैं।

Validate an access token

get

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.

Authorizations
AuthorizationstringRequired

An rfoa_ OAuth access token.

Responses
200

The token's state.

application/json
activebooleanRequired

True when the token is live. When false, every other field is null or empty.

expinteger · nullableRequired

Expiry time in seconds since the Unix epoch.

workspace_urlstring · nullableRequired

URL slug of the workspace the token is bound to.

workspace_idstring · nullableRequired

Id of that workspace.

user_idstring · nullableRequired

The Roboflow user the token acts for.

granted_scopesstring[]Required

Scopes granted when the user consented. Use it only to rule a request out early.

scopesstring[]Required

Scopes the token carries now. Authoritative: a scope can be removed before the token expires.

get/oauth/validate
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 करे, तब इसे कॉल करें।

Revoke a token

post

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.

Authorizations
AuthorizationstringOptional

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.

Body
tokenstringRequired

An rfoa_ access token or rfor_ refresh token.

Example: rfoa_QWNjZXNzVG9rZW5FeGFtcGxl
token_type_hintstring · enumOptional

Which kind of token you are sending. Optional.

Possible values:
client_idstringOptional

Your client ID. Required unless you send it in the HTTP Basic header.

Example: YOUR_CLIENT_ID
client_secretstringOptional

Your client secret, for apps set to client_secret_post.

Example: rfcs_YOUR_CLIENT_SECRET
Responses
200

The token is revoked. The body is empty. An unknown or already revoked token also returns 200.

No content

post/oauth/revoke
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 की आवश्यकता होती है।

Get user info

get

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.

Authorizations
AuthorizationstringRequired

An rfoa_ OAuth access token.

Responses
200

The user's claims.

application/json
substringRequired

Stable Roboflow user id.

namestringOptional

Display name. Requires profile.

emailstringOptional

Email address. Requires email or profile.

get/oauth/userinfo
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

Scope
विवरण

openid

में एक स्थिर user ID लौटाता है sub claim। एक id_token और user info के लिए आवश्यक।

profile

उपयोगकर्ता का display name और email address पढ़ें।

email

उपयोगकर्ता का email address पढ़ें।

API Scopes

Scope
विवरण

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 हटाएँ

अतिरिक्त scopes
Scope
विवरण

device:read

devices पढ़ें

device:update

device settings अपडेट करें

vision-events:read

vision events पढ़ें

vision-events:write

vision events बनाएं

vision-events:manage

vision event use cases प्रबंधित करें

annotation-job:create

annotation jobs बनाएं

annotation-job:read

annotation jobs पढ़ें

video-inference-job:create

video inference jobs बनाएं

video-inference-job:read

video inference jobs पढ़ें

integration:create

integrations बनाएं

integration:delete

integrations हटाएँ

credentials:create

credentials बनाएं

credentials:read

credentials पढ़ें

credentials:update

credentials अपडेट करें

credentials:delete

credentials हटाएँ

data-staging:read

staged data पढ़ें

data-staging:write

staged data लिखें

data-staging:delete

staged data हटाएँ

batch-processing:read

batch jobs पढ़ें

batch processing ट्रिगर करें

batch:read

batches पढ़ें

workspace statistics पढ़ें

workspace-stats:read

workspace statistics पढ़ें

OIDC Discovery

Roboflow मानक OpenID Connect discovery documents प्रकाशित करता है। OAuth और OIDC client libraries ऊपर दिए गए endpoints खोजने के लिए उन्हें पढ़ती हैं।

  • OpenID Configuration: https://app.roboflow.com/.well-known/openid-configuration

  • ID tokens सत्यापित करने के लिए JWKS: https://app.roboflow.com/.well-known/jwks.json

अगले चरण

अंतिम अपडेट

क्या यह उपयोगी था?