I am quite new to AWS-based development and LocalStack, and currently stuck in using the _aws/cognito-idp/oauth2/authorize API to perform user authentication and login.
The javascript library I am using is aws-amplify and I am able to configure it so as to obtain an authentication URL as follows:
According to this LocalStack gitHub issue [1], it is supposed to be redirected to https://localhost:4566/_aws/cognito-idp/login?. However, it only works when the identity_provider field is removed from the above URL or it is set to empty.
I couldn’t find an approach to avoid embedding this field identity_provider in the URL parameters on the aws-amplify side. Thus, I would like to ask if LocalStack is able to handle this field when accessing oauth2/authorize API or it is due to a potential bug.
Thank you for the report. We have confirmed the issue and are currently working on an implementation that should resolve the problem. We will notify you once it is available in the latest LocalStack Docker image version.
@Marcel Thanks for providing the patch, and now identity_provider seems not to be the road blocker for redirecting.
However, I am facing another issue, in which after authentication, I am redirected to the url http://localhost:5000/data-view?state=IDYUDjvYDKRfIUN2pCArfNCTvInTqD1X&code=332754, but shortly another page flashes (as shown in the attached image) and quickly I am again redirected to the above authentication page.
By using the dev tool of chrome, I saw one bad request targeting https://cognito-identity.eu-west-1.amazonaws.com/. Any idea on how it happens would help a lot.