Roboflow로 로그인(개발자 참고)
Roboflow로 로그인의 OAuth 참고 자료, 표시 여부, 오류, 예제 앱.
Sign in with Roboflow를 사용하는 앱을 위한 참고 자료입니다. 앱 등록, PKCE 및 인가 흐름은 다음을 참조하세요 Roboflow로 로그인하기(시작하기).
예제 앱
roboflow/siwr_example_app 는 app.roboflow.com 및 api.roboflow.com. 토큰은 Express 세션에 유지되며, 브라우저는 클라이언트 시크릿을 절대 보지 않습니다.
git clone https://github.com/roboflow/siwr_example_app.git
cd siwr_example_app
cp .env.example .env
# RF_CLIENT_ID, RF_CLIENT_SECRET, SESSION_SECRET 설정
npm install && npm run dev리디렉션 URI가 있는 OAuth 앱 등록 http://localhost:3001/oauth/callback 및 앱이 사용하는 스코프(openid, profile, email, workspace:read, project:read, model:infer).
GET /
랜딩 페이지, 또는 로그인 후 대시보드
GET /oauth/start
PKCE 리디렉션으로 OAuth 시작
GET /oauth/callback
코드를 교환하고 대시보드 표시
POST /logout
토큰을 폐기하고 세션을 지우기
PKCE 및 인가 URL
출처 src/oauth.ts:
export function pkcePair(): { verifier: string; challenge: string } {
const verifier = crypto.randomBytes(48).toString("base64url");
const challenge = crypto.createHash("sha256").update(verifier).digest("base64url");
return { verifier, challenge };
}
export function buildAuthorizeUrl(state: string, codeChallenge: string): string {
const url = new URL(`${config.appHost}/oauth/authorize`);
url.searchParams.set("response_type", "code");
url.searchParams.set("client_id", config.clientId);
url.searchParams.set("redirect_uri", config.redirectUri);
url.searchParams.set("scope", REQUESTED_SCOPE_STRING);
url.searchParams.set("state", state);
url.searchParams.set("code_challenge", codeChallenge);
url.searchParams.set("code_challenge_method", "S256");
return url.toString();
}GET /oauth/start 저장 verifier 및 state 를 세션에 저장한 다음 이 URL로 리디렉션합니다.
콜백 및 상태 확인
출처 src/server.ts:
코드를 교환하기 전에 일회성 OAuth 세션 데이터를 항상 지우세요. exchangeCodeForTokens 는 코드를 POST하고, redirect_uri, code_verifier, 클라이언트 ID 및 클라이언트 시크릿을 토큰 엔드포인트.
토큰 엔드포인트 인증
Workspace OAuth 앱은 기밀 클라이언트입니다. 토큰, revoke, introspect 엔드포인트에 대한 모든 호출에는 클라이언트 시크릿이 포함됩니다. 앱을 "Workspace Settings > Developer"에서 생성하거나 수정할 때, 클라이언트 또는 게이트웨이에 맞는 방법을 선택하세요.
client_secret_post
전송 client_id 및 client_secret 를 요청 본문의 폼 필드로 보냅니다. 기본값입니다.
client_secret_basic
HTTP Authorization: Basic 헤더와 base64로 인코딩된 client_id:client_secret를 보내고, 본문에는 둘 다 넣지 않습니다.
자체 등록하는 MCP 커넥터와 같은 공개 클라이언트는 client_id 만 전송하고 PKCE에 의존합니다.
호스트
로그인, 토큰, OIDC
https://app.roboflow.com
REST API
https://api.roboflow.com
표시 설정
어떤 워크스페이스가 OAuth 앱으로 로그인할 수 있는지 제어합니다.
내부
앱을 만든 워크스페이스의 멤버만
비공개 목록
귀하의 클라이언트 ID를 가진 모든 워크스페이스
공개
비공개 목록과 동일하며, 활성화되어 있을 때 Sign in with Roboflow 디렉터리에 등록도 포함됩니다
별도의 "External" 표시 유형은 없습니다. 워크스페이스 간 통합은 비공개 목록을 사용합니다.
각 고객 워크스페이스는 External OAuth 앱 정책도 설정할 수 있습니다: 모두 허용, 나열된 클라이언트 ID만 허용, 또는 모두 차단. 워크스페이스 외부에서 로그인에 실패하면 고객에게 워크스페이스 설정에서 귀하의 클라이언트 ID를 허용해 달라고 요청하세요.
엔드포인트
모든 로그인 및 토큰 엔드포인트는 다음에 있습니다 app.roboflow.com.
인가(브라우저 리디렉션)
GET
/oauth/authorize
OIDC 검색
GET
/.well-known/openid-configuration
검증용 JWKS, id_token JWT
GET
/.well-known/jwks.json
토큰 검사
클라이언트 자격 증명을 사용하여 토큰이 활성 상태인지와 부여하는 권한을 반환합니다. 클라이언트 자격 증명 없이 액세스 토큰을 확인하려면 토큰 검증 을 사용하세요.
Returns whether a token is active and what it grants (RFC 7662). The client authenticates the same way as on the token endpoint. A public client can only introspect its own tokens. To check an access token without client credentials, use the validate endpoint instead.
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's state. An expired, revoked or unknown token returns only {"active": false}.
True when the token is live.
The OAuth client the token was issued to.
The Roboflow user id.
Space-separated scopes.
Expiry time in seconds since the Unix epoch.
Issue time in seconds since the Unix epoch.
Issuer, https://app.roboflow.com.
Bearer for an access token.
Workspace the token is bound to.
URL slug of that workspace.
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/introspect 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'"{
"active": true,
"client_id": "YOUR_CLIENT_ID",
"sub": "user_abc123",
"scope": "openid workspace:read project:read",
"exp": 1893456000,
"iat": 1893452400,
"iss": "https://app.roboflow.com",
"token_type": "Bearer",
"workspace_id": "5f3Tq8k2ZbW1aXyZ",
"workspace_url": "your-workspace"
}REST API에서 토큰 사용
전송 Authorization: Bearer {access_token} 에 api.roboflow.com. 다음을 참조하세요 REST API로 인증하기.
일반적인 오류
400 invalid_scope
요청된 스코프가 앱의 "Allowed scopes" 목록에 없습니다.
대시보드에 스코프를 추가하거나 요청에서 제거하세요.
400 invalid_grant
코드 또는 새로고침 토큰이 만료되었거나, 사용되었거나, 폐기되었거나, 워크스페이스가 더 이상 앱을 허용하지 않습니다.
사용자를 다시 로그인 과정으로 보내세요.
401 invalid_client
잘못된 클라이언트 ID 또는 시크릿이거나, 잘못된 방법으로 시크릿이 전송되었습니다.
앱의 토큰 엔드포인트 인증 설정을 확인하세요.
401 OAuthException 에서 api.roboflow.com
액세스 토큰이 만료되었거나 폐기되었습니다.
한 번 새로고침한 다음 사용자를 다시 로그인 과정으로 보내세요.
404 GraphMethodException 에서 api.roboflow.com
토큰에 해당 경로의 스코프가 없거나, 경로가 토큰이 바인딩되지 않은 워크스페이스에 있습니다.
필요한 스코프로 사용자가 다시 동의하도록 요청하세요.
403에서 api.roboflow.com
사용자의 역할이 작업을 허용하지 않습니다.
워크스페이스 관리자가 사용자의 역할을 변경합니다.
리디렉션 불일치
redirect_uri 가 등록된 리디렉션 URI와 일치하지 않습니다.
대시보드 항목 또는 인가 URL을 수정하세요.
보안
모든 인가 요청에 PKCE를 사용하세요.
확인
state을 모든 콜백에서.노출하지 마세요
client_secret또는 새로고침 토큰을 브라우저에.사용자가 로그아웃하면 토큰을 폐기하세요.
필요한 스코프만 요청하세요. 전체 목록은 다음에서 확인하세요 사용 가능한 스코프.
마지막 업데이트
도움이 되었나요?