TDTech Digest

156. Salesforce Client Credentials 인증 설정 (Set up Client Credentials authentication)

  • 원문: English
  • 위치: Additional capabilities › Knowledge Bases › Build a managed knowledge base › Create a managed knowledge base › Connect a data source › Salesforce › Set up Client Credentials authentication

한 줄 요약

Salesforce External Client App을 만들어 OAuth(api scope)와 Client Credentials Flow를 켜고, Run-As 통합 사용자를 지정한 뒤 Consumer Key/Secret과 instanceUrl을 Secrets Manager에 저장합니다. Salesforce 사용자 이름·비밀번호·보안 토큰은 저장하지 않습니다.

쉽게 말하면

“앱 하나 만들고 → 이 앱은 통합 사용자 OOO으로 동작한다고 지정 → 키·시크릿·도메인 URL을 AWS에 저장"입니다.

핵심 내용

📝 최신 org는 클래식 Connected App의 후속인 External Client App Manager에서 만듭니다. OAuth 동작(client_credentials grant, scope, Run-As, Consumer Key/Secret)은 동일합니다.

사전 준비

  • External Client App 관리 가능한 관리자, My Domain 활성화, 최소 권한·비대화형 전용 통합 사용자

설정 단계

단계요점
1. 앱 생성Setup › External Client App Manager › New. 이름·API Name·Contact Email, Distribution State = Local
2. OAuth·scopeEnable OAuth, Callback URL은 필수 필드라 아무 HTTPS URL(예: https://login.salesforce.com/services/oauth2/callback), scope Manage user data via APIs (api) (Knowledge 크롤링용)
3. Flow 활성화Enable Client Credentials Flow → Save and Continue
4. Run-As 사용자Policies › OAuth Policies에서 Client Credentials Flow 확인, Run As = 통합 사용자
5. 키 조회Settings › OAuth Settings › Consumer Key and Secret (본인 확인 요청 가능)
6. 시크릿 생성지식 기반과 같은 리전
  • 💡 최소 권한: Run-As 사용자는 크롤링할 Knowledge 문서(및 데이터 카테고리) 읽기 권한만. 이 커넥터 전용으로 쓰고 UI 대화형 로그인에는 절대 쓰지 마세요.

시크릿 형식

{
  "clientId": "<consumer-key>",
  "clientSecret": "<consumer-secret>",
  "instanceUrl": "https://your-domain.my.salesforce.com"
}
필드설명
clientId / clientSecretConsumer Key / Consumer Secret
instanceUrlMy Domain 기본 URL (https:// 포함, 끝 / 없음). 토큰 엔드포인트 {instanceUrl}/services/oauth2/token이자 크롤링 API 기본 주소. ⚠️ 데이터 소스 연결의 hostUrl과 일치해야 함
  • 실행 역할에 secretsmanager:GetSecretValue 필요
  • 다음: 158. ACL을 쓰려면 데이터 소스 생성 전에 157도 완료

SA 관점

  • 크롤링 범위 = Run-As 사용자 권한이므로, ACL을 쓰지 않는다면 Run-As 사용자가 읽을 수 있는 문서는 지식 기반 질의 권한자 모두에게 노출된다고 보고 권한을 설계하세요.
  • ACL 도입 가능성이 있다면 처음부터 JWT Bearer까지 설정하는 편이 재작업이 적습니다.