I have a traditional web app (as in a hobby project I made 15 years ago) that I am moving to AWS. It is deployed in ECS with Fargate, behind an Application Loadbalancer. Now, I want to add authentication with FB and Google. I have managed to configure both FB and Google so that I get authenticated, but I am having troubles with the authenticate rule in ALB. At the end of a successful authentication, I get "redirect_mismatch". If I try to set my redirect_uri to an external site (such as www.google.com) and add that site to my whitelist, it works fine. As far as I can see, there are no typos.
Attempting to browse to https://myapp.domain.se/ will redirect to the login flow, and when done land in a redirect_mismatch error. https://myapp.auth.eu-west-1.amazoncognito.com/login?response_type=code&client_id=2b88s...&redirect_uri=https://www.google.com otoh works fine.
What am I missing. How can I get a more verbose error message?
You can configure an Application Load Balancer to securely authenticate users as they access your applications. This enables you to offload the work of authenticating users to your load balancer so that your applications can focus on their business logic.
A user pool is a user directory in Amazon Cognito. With a user pool, your users can sign in to your web or mobile app through Amazon Cognito. Your users can also sign in through social identity providers like Google, Facebook, Amazon, or Apple, and through SAML identity providers.
If you're new to Amazon Cognito Sync, use AWS AppSync . Like Amazon Cognito Sync, AWS AppSync is a service for synchronizing application data across devices. It enables user data like app preferences or game state to be synchronized.
The two main components of Amazon Cognito are user pools and identity pools. User pools are user directories that provide sign-up and sign-in options for your app users. Identity pools enable you to grant your users access to other AWS services. You can use identity pools and user pools separately or together.
The callback URL values are a bit complicated and not intuitive without reading the documentation for Application Load Balancer use case.
The short version is that you will need to add three values to your callback urls:
See: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/listener-authenticate-users.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With