awslabs / cognito-at-edge

Serverless authentication solution to protect your website or Amplify application
Apache License 2.0
191 stars 57 forks source link

Constantly re-directing after successful authentication #54

Closed edas-smith closed 1 year ago

edas-smith commented 1 year ago

Hello guys,

Currently i'm hitting with too many redirects issue, even after successful authentication with google.

My setup involves using Cognito, which allows to login via google.

I have configured my Cognito callBackUrls same as my site url https://xyz.test.com.

Has anyone had anything similar know why this could be?

Thank you!

nagendrakumar02 commented 1 year ago

I am trying to use a SAML provider, How are you able to pass different id providers from the code?

edas-smith commented 1 year ago

Basically using the same code as you @nagendrakumar02 https://github.com/awslabs/cognito-at-edge/issues/56

jeandek commented 1 year ago

Hi @edas-smith ,

If that is not already the case, I suggest upgrading to the latest version of cognito-at-edge (1.3.1) as it fixes an issue with cookie parsing that could cause redirection loops in some cases.

If you are building a web app using AWS Amplify, you may want to try to authenticate to the Cognito userpool from within your app using Auth.federatedSignIn(). That would allow you to determine if the issue comes from your user pool configuration or from the Lambda@Edge function.

edas-smith commented 1 year ago

Hello @jeandek I have checked and it definitely is up to date. I think the error will likely be on my end somewhere, rather than an actual issue. Will close.