Anyone have a working AWS Cognito configuration w/ ouath2, openid or sso?

I’m trying to integrate Discourse with our existing Cognito UserPool.

Don’t have any IdP or SAML setup in AWS for sso so haven’t gone there.

Tried w/ openid plugin but it Discourse redirects login to the /AUTHORIZE endpoint in Cognito instead of /LOGIN - I know it gets this from the configuration in .well-known, but not sure how this is suppose to work.

Tried w/ oauth2 plugin - I see Discourse calling the /TOKEN endpoint and receiving the JWT back from Cognito, but the /USERINFO endpoint then returns an error, so it doesn’t get beyond that.

Does anyone have a working config they can share - oauth2 seems like the best route but I’m missing something somewhere apparently.

이건 어떻게 진행하셨나요?

저도 같은 필요가 있습니다.

감사합니다.

Todd

안녕하세요 - 아직 아무도 답변을 주지 않았고, 불행히도 저도 직접 다시 확인해 볼 기회가 없었습니다.

AWS Cognito를 OpenID Connect 플러그인의 인증 제공자(Identity Provider)로 사용하는 경우

  1. AWS Cognito 웹 콘솔에서 Create a User Pool(사용자 풀 생성) 버튼을 클릭하세요.
  2. Review Defaults(기본값 검토)를 클릭하여 대부분 기본 설정을 사용하세요.
    2a. 풀을 생성하기 전에 Add an App Client(앱 클라이언트 추가)를 클릭해야 합니다.
    2b. 앱 클라이언트를 생성하고 이름을 부여한 후, Enable refresh token based authentication (ALLOW_REFRESH_TOKEN_AUTH)(리프레시 토큰 기반 인증 활성화) 옵션만 선택하고 나머지는 모두 해제하세요.


3. Create pool(풀 생성)을 클릭하세요.
4. 이제 왼쪽 메뉴의 General Settings(일반 설정) 아래에서 App Client를 클릭하고 App client id(앱 클라이언트 ID) 및 App client secret(앱 클라이언트 시크릿) 값을 확인하여 기록해 두세요.
5. 다음으로 왼쪽 메뉴의 App integration(앱 통합) 아래에서 Domain name(도메인 이름)을 클릭합니다. 여기에 서브도메인을 입력하세요. 여기서 입력한 이름은 사용자가 로그인할 때 라우팅되는 도메인이 됩니다.

6. AWS Cognito 콘솔의 왼쪽 상단에서 Federated Identities(연동된 ID)를 클릭하세요. 찾기가 조금 어렵습니다.
federated-identities
7. 해당 페이지에서 Create new identity pool(새 ID 풀 생성)을 클릭하세요.
8. ID 풀에 이름을 부여하세요.
8b. Authentication providers(인증 제공자) 섹션에서 이전에 생성한 User pool의 User Pool ID와 이전에 생성한 App client의 App client id를 사용하세요.


9. Create Pool(풀 생성)을 클릭하고 콘솔이 새로운 ID 풀과 함께 사용할 IAM 역할을 생성하도록 허용하세요.
10. 이 시점에서 플러그인이 설치되어 있다고 가정하면, Discourse 인스턴스를 올바른 사이트 설정으로 구성하기 위해 필요한 거의 모든 준비가 끝났습니다.

openid connect enabled: 이 옵션을 활성화하세요.
openid connect client id: 앞서 단계에서 가져온 App Client Id를 사용하세요.
openid connect client secret: 앞서 단계에서 확인한 App Client Secret을 사용하세요.
openid connect discovery document: 디스커버리 문서 URL 링크는 아래 형식을 따릅니다. userPoolId의 형식은 8b 단계의 스크린샷에서 확인할 수 있습니다..

https://cognito-idp.{region}.amazonaws.com/{userPoolId}/.well-known/openid-configuration

URL 형식이 올바른지 확인하려면 브라우저에 붙여넣어 보세요. 인증 엔드포인트, 발급자(issuer) 및 기타 정보를 반환하는 JSON을 확인할 수 있어야 합니다.

openid connect authorize scope: openid email


도움이 될 수 있는 기타 사항