AWS ALB 프록시 공급자
Backstage는 AWS Application Load Balancer 뒤에 배포하여 사용자가 원활하게 인증되도록 할 수 있습니다.
출처: 문서
본문
Backstage는 AWS Application Load Balancer 뒤에 배포할 수 있으며, 사용자가 원활하게 인증되도록 할 수 있습니다.
구성
공급자 구성은 루트 auth 구성 아래의 app-config.yaml에, 다음 예시와 비슷하게 추가할 수 있습니다.
app-config.yaml
auth: providers: awsalb: # this is the URL of the IdP you configured issuer: 'https://example.okta.com/oauth2/default' # this is the ARN of your ALB instance signer: 'arn:aws:elasticloadbalancing:us-east-2:123456789012:loadbalancer/app/my-load-balancer/1234567890123456' # this is the region where your ALB instance resides region: 'us-west-2' ## uncomment to set lifespan of user session # sessionDuration: { hours: 24 } # supports `ms` library format (e.
signer를 올바르게 설정했는지 확인하세요. 또한 대상 그룹의 보안 정책을 해당 ALB에서 오는 연결만 수락하도록 제한하는 것이 좋습니다.
선택 사항
sessionDuration: 사용자 세션의 수명.
리졸버
이 공급자는 바로 사용할 수 있는 여러 리졸버를 포함합니다.
-
emailMatchingUserEntityProfileEmail: auth 공급자의 이메일 주소를 일치하는spec.profile.email을 가진 User 엔티티와 매칭합니다. 일치하는 항목이 없으면NotFoundError를 던집니다. -
emailLocalPartMatchingUserEntityName: auth 공급자의 이메일 주소의 로컬 부분을 일치하는name을 가진 User 엔티티와 매칭합니다. 일치하는 항목이 없으면NotFoundError를 던집니다.
note
리졸버는 순서대로 시도되지만 NotFoundError를 던질 때만 건너뜁니다.
이 리졸버들이 요구 사항에 맞지 않는다면 커스텀 리졸버를 만들 수 있습니다. 이는 Sign-in Identities and Resolvers 문서의 Building Custom Resolvers 섹션에서 다룹니다.
백엔드 설치
공급자를 백엔드에 추가하려면 먼저 다음 명령을 실행해 패키지를 설치해야 합니다.
Backstage 루트 디렉토리에서
yarn --cwd packages/backend add @backstage/plugin-auth-backend-module-aws-alb-provider
그런 다음 이 줄을 추가해야 합니다.
packages/backend/src/index.ts에
backend.add(import('@backstage/plugin-auth-backend'));backend.add(import('@backstage/plugin-auth-backend-module-aws-alb-provider'));
공급자를 Backstage 프론트엔드에 추가하기
로그인 페이지를 설정하고 로컬 개발에서도 원활히 작동하도록 하는 방법에 대한 안내는 Sign-In with Proxy Providers를 참조하세요. 공급자 이름으로 awsalb를 사용하게 됩니다.
커스텀 로그인 리졸버를 제공한다면 signIn 블록을 완전히 건너뛸 수 있습니다.