Using external oAuth2 system

0

I'm working on a web application. This uses API's from a 3rd party system. To authenticate with the system a plain oauth2 scheme is used. A call is made to the /authorize endpoint. This redirects to a login page. Upon successful login, the user gets redirected to a URL with am authorization-code as parameter. Using this authorization-code an access token is then requests through the /tokens endpoint. This returns a simple JSON document with the bearer token (no JWT), expiry time and refresh token. Works fine.

I would now like to authenticate my own API's (API gateway REST or HTTP API's) against this 3rd party system. Would there be a way to integrate this with e.g. COGNITO is some way? Ideally Cognito should "front" this 3rd party system and just provide me app a JWT or so. Or are there solutions to authorize API gateway directly against such a 3rd party?

Thanks.

질문됨 4년 전390회 조회
2개 답변
0

In theory, this should work out of the box as a JWT authoriser with APIGW HTTP APIs [1]. Every OAuth2/OIDC implementation has quirks, though, so interoperability isn't guaranteed. You'll need to work out the issuer endpoint for your authentication provider -- it should be the iss claim in a JWT issued by the provider.

Also, I'm pretty sure APIGW doesn't support redirecting unauthenticated requests to the authentication provider's authorisation endpoint. That might make things a bit trickier, depending on how your front-end app works.

[1] https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-jwt-authorizer.html

jamess
답변함 4년 전
0

I reworked the architecture to handle this differently.

답변함 4년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠