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

Invalid state #53

Open
HarunKilic opened this issue Apr 29, 2024 · 7 comments
Open

Invalid state #53

HarunKilic opened this issue Apr 29, 2024 · 7 comments

Comments

@HarunKilic
Copy link

Describe the bug
After setup when I forward a port it gives an url, when going to the URL it asks for login, after login, it says "Invalid state'

@amalshaji
Copy link
Owner

Can you add a screenshot?

@HarunKilic
Copy link
Author

Sure, its pretty empty tho:
image

@amalshaji
Copy link
Owner

Is this a screenshot of the browser? Can you add more info?

@HarunKilic
Copy link
Author

Yes.
I get error 400 from the admin app.
https://portr.example.com/api/v1/auth/github/callback?code=SOME_CODE&state=SOME_STATE

It might be due to the infrastructure.
I've forwarded the port 8000 through Nginx Proxy Manager. Which works fine.
Port 2222 is forwarded using iptables to extern server with tailscale.

@amalshaji
Copy link
Owner

Must be, can you check if this cookie is being set correctly

existing_state = request.cookies.get("oauth_state")
if state != existing_state:
return Response(status_code=400, content="Invalid state")

@HarunKilic
Copy link
Author

Yea, there is two cookies:
image

@amalshaji
Copy link
Owner

amalshaji commented May 1, 2024

Can you check if the state in the callback and the cookie is the same? Ideally, they should be

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

2 participants