Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: OAuth2.0 flow #58

Open
ankurLalitAtPropertyMe opened this issue Feb 9, 2021 · 0 comments
Open

Question: OAuth2.0 flow #58

ankurLalitAtPropertyMe opened this issue Feb 9, 2021 · 0 comments

Comments

@ankurLalitAtPropertyMe
Copy link

Hi Team,

What you have achieved here is fantastic by all means and fills a huge gap in achieving a separation between apps that want a token and the intermediary that interacts with the IDP.

My question is around its adherence to Authorization code grant flow. According to the post here

and its point 3b states "After successful authentication the provider redirects the user to https://AUTH_DOMAIN/oauth2/idpresponse with either an authorization token in the “code” query parameter or a SAML assertion in a POST request".

This would mean that the broker in your implementation, after successful authentication should not get hold of any tokens from Cognito. Instead the caller should get a redirect 302 to the application where the request originated from. 
What I see in Network Trace is that there goes a POST to Cognito using AWSCognitoIdentityProviderService.RespondToAuthChallenge and the very next call is to AWSCognitoIdentityProviderService.GetUser which contains AccessToken in its request. This means that the Amplify library or custom code that is making these calls in the Broker is using a process flow that is different from the standard OAuth2.0 flow. The tokens should have been unavailable to the broker unless the request originated from the broker and the clientid was of the broker itself. The only way to obtain tokens should have been after the redirection to the originating app using the code in the query string by querying the token endpoint of the broker.

Do you see a scope of improvement in the Broker (Amplify) or its communication with Cognito such that the Standard OAuth 2.0 flow is achieved?

Screen Shot 2021-02-10 at 10 35 17 am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant