본문으로 건너뛰기

AI agents can use the SimplePost documentation index at /llms.txt to find related guides.

Bluesky OAuth 앱 설정

Bluesky는 AT Protocol OAuth를 사용합니다. 중앙 집중식 개발자 앱 등록 포털은 없습니다. 앱은 공개 클라이언트 메타데이터 JSON 문서로 식별됩니다.

호스팅 Scheduler는 자체 Bluesky OAuth 클라이언트를 제공합니다. 로컬 CLI OAuth 연결은 SIMPLE_POST_BLUESKY_CLIENT_ID에 직접 호스팅한 클라이언트 메타데이터 URL을 사용합니다. 더 간단한 로컬 SDK 설정에는 앱 비밀번호를 사용하거나, CLI를 호스팅 Scheduler에 연결하여 기존 계정을 재사용할 수 있습니다.

클라이언트 메타데이터​

공개 HTTPS URL에 JSON 문서를 호스팅하세요. 이 문서의 URL은 client_id이기도 합니다.

브라우저 또는 퍼블릭 클라이언트 예시:

{
"client_id": "https://yourapp.com/oauth/client-metadata.json",
"application_type": "web",
"client_name": "Your App Name",
"client_uri": "https://yourapp.com",
"dpop_bound_access_tokens": true,
"grant_types": ["authorization_code", "refresh_token"],
"redirect_uris": ["https://yourapp.com/oauth/callback"],
"response_types": ["code"],
"scope": "atproto transition:generic",
"token_endpoint_auth_method": "none"
}

기밀(confidential) 서버 측 클라이언트 예시:

{
"client_id": "https://yourapp.com/oauth/client-metadata.json",
"application_type": "web",
"client_name": "Your App Name",
"client_uri": "https://yourapp.com",
"dpop_bound_access_tokens": true,
"grant_types": ["authorization_code", "refresh_token"],
"redirect_uris": ["https://yourapp.com/oauth/callback"],
"response_types": ["code"],
"scope": "atproto transition:generic",
"token_endpoint_auth_method": "private_key_jwt",
"token_endpoint_auth_signing_alg": "ES256",
"jwks": {
"keys": [
{
"kty": "EC",
"crv": "P-256",
"x": "YOUR_PUBLIC_KEY_X",
"y": "YOUR_PUBLIC_KEY_Y",
"kid": "key-1"
}
]
}
}

필수 필드​

필드필수 여부참고
client_id예메타데이터 URL과 정확히 일치해야 합니다.
dpop_bound_access_tokens예true이어야 합니다.
grant_types예authorization_code 및 refresh_token을 사용하세요.
redirect_uris예콜백 URL 목록입니다.
response_types예code을 사용하세요.
scope예atproto을 포함해야 합니다.
token_endpoint_auth_method아니요퍼블릭 클라이언트는 none, 기밀 클라이언트는 private_key_jwt입니다.

ES256 키 생성​

Node.js 사용:

import crypto from "node:crypto";

const { privateKey, publicKey } = crypto.generateKeyPairSync("ec", {
namedCurve: "P-256",
});

const privateJwk = privateKey.export({ format: "jwk" });
const publicJwk = publicKey.export({ format: "jwk" });

privateJwk.kid = "key-1";
publicJwk.kid = "key-1";

console.log("Public JWK:", JSON.stringify(publicJwk, null, 2));
console.log("Private JWK:", JSON.stringify(privateJwk, null, 2));

개인 키는 시크릿 관리자 또는 암호화된 서버 구성에 보관하세요. 공개 키는 메타데이터 문서에 넣습니다.

OAuth 흐름 요구 사항​

Bluesky OAuth는 다음을 사용합니다.

  • 인증 코드 교환을 위한 PKCE.
  • PAR(Pushed Authorization Request, 푸시된 인증 요청).
  • 토큰 및 API 요청을 위한 DPoP 증명.
  • DPoP-Nonce 헤더의 nonce 처리.

Scheduler는 연결된 Bluesky 계정에 대해 이를 구현합니다. 직접 OAuth 흐름을 구축하는 경우 가능하면 공식 AT Protocol OAuth 라이브러리를 사용하세요.