120. OAuth 2.0 인증 설정 (Set up OAuth 2.0 authentication)
- 원문: English
- 위치: Additional capabilities › Knowledge Bases › Build a managed knowledge base › Create a managed knowledge base › Connect a data source › Box › Set up OAuth 2.0 authentication
한 줄 요약
특정 사용자 대신(3LO) Box 앱으로 인증해 그 사용자가 볼 수 있는 콘텐츠만 크롤링하는 방식입니다. ACL 미지원이며, CCG를 쓸 수 없을 때만 사용합니다.
쉽게 말하면
사용자 한 명이 직접 로그인해 토큰을 발급받고, 그 토큰을 시크릿에 넣어두는 수동 방식입니다.
핵심 내용
단계 요약
| 단계 | 할 일 |
|---|---|
| 1. 앱 생성 | Box Developer Console › Create a New App › User Authentication (OAuth 2.0) (앱 유형: User) |
| 2. 리디렉션 URI | 기존 엔드포인트가 없으면 테스트용 https://httpbin.org/anything |
| 3. 콘텐츠 권한 | Read All Files and Folders + Write All Files and Folders. 관리 권한·as-user 헤더는 켜지 않음 |
| 4. 토큰 발급 | 크롤링할 사용자로 Box 로그인 → https://account.box.com/api/oauth2/authorize?response_type=code&client_id=...&state=... 접속 → 리디렉션 URL의 code 복사 → https://api.box.com/oauth2/token에 grant_type=authorization_code로 교환 → access_token, refresh_token 확보 |
| 5. 시크릿 생성 | 아래 JSON 저장, ARN을 secretArn으로 사용 |
- ⚠️
httpbin.org는 자격 증명 생성용 테스트 엔드포인트입니다. 운영에는 쓰지 마세요.
시크릿 형식
{
"clientId": "your-client-id",
"clientSecret": "your-client-secret",
"accessToken": "your-access-token",
"refreshToken": "your-refresh-token"
}
- 다음 단계:
authType을OAUTH2로 데이터 소스 생성 → 122
SA 관점
- 개인 사용자 토큰 기반이라 운영 안정성(사용자 퇴사, 토큰 만료)이 약합니다. PoC나 개인 폴더 범위 RAG에만 권하고, 운영은 CCG를 기본으로 제안하세요.
- 이 방식보다 더 간단한 대안은 콘솔 로그인 기반 사용자 관리형 설정입니다 → 121.