vouch / vouch-proxy

an SSO and OAuth / OIDC login solution for Nginx using the auth_request module
MIT License
2.81k stars 325 forks source link

after successful validation through cognito, not redirecting back to the original URL #564

Open tspoorthyreddy opened 2 weeks ago

tspoorthyreddy commented 2 weeks ago

vouch.log

vouch config.yml

https://hasteb.in/WMqNClM4mIaJPqn

nginx config file

https://hasteb.in/6AaAHyaHUbrAVRj

when the user access https://conn.xyz/info nginx redirects it to vouch-proxy it validates and if the user is not authenticated it redirects him to the cognito login url that is (https://infosite.auth.us-east-1.amazoncognito.com/login?client_id=64ekbs9qaoobilxxxxxxxxxx&response_type=code&scope=email+openid+profile&redirect_uri=https%3A%2F%2Fconn.xyz%2Fauth) and after the user enters his credentials and after the validation is done according to this log from vouch.log (99.235.181.119 - - [13/Jun/2024:00:46:12 +0000] "GET /auth?code=2d6b2b13-b7b7-4e2d-9799-bbeb45324c14&state=55U4UyK5uuIPRzOyBAYSXZ3bcHKWk84 HTTP/1.1" 200 4192 "https://infosite.auth.us-east-1.amazoncognito.com/login?)it is redirecting them back to the application but instead of redirecting back to the original URL they were trying to access i.e https://conn.xyz/info and displaying its content it is going to https://connflex.xyz/auth/9OTE2rGQ53fE24JKiJ6HH06QYLewdx/?code=92a0d07e-3fbf-4bc0-bab2-ba1b9878a80f&state=9OTE2rGQ53fE24JKiJ6HH06QYLewdx and showing 403 forbidden page

Please let me know if any other information is required to trouble shoot this issue.

bnfinet commented 2 weeks ago

Please read the README for instructions on what to provide for a support request. Thanks much.

tspoorthyreddy commented 2 weeks ago

updated vouch log file in the above issue. Please let me know if any other information is required to trouble shoot this issue.

bnfinet commented 2 weeks ago

Please put the log in a gist or paste service so we can both reference line numbers, etc

tspoorthyreddy commented 2 weeks ago

https://gist.github.com/tspoorthyreddy/5f45b3246a66eeb790db0783064abd16 vouch.log https://hasteb.in/S39tqnpEC33arcM

tspoorthyreddy commented 1 week ago

after the authentication in cognito it keeps redirecting and throws this error ERR_TOO_MANY_REDIRECTS https://hasteb.in/Rotp8NNSw4TXx1V