portr icon indicating copy to clipboard operation
portr copied to clipboard

Invalid state

Open HarunKilic opened this issue 1 year ago • 7 comments

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'

HarunKilic avatar Apr 29 '24 12:04 HarunKilic

Can you add a screenshot?

amalshaji avatar Apr 29 '24 13:04 amalshaji

Sure, its pretty empty tho: image

HarunKilic avatar Apr 29 '24 13:04 HarunKilic

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

amalshaji avatar Apr 29 '24 13:04 amalshaji

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.

HarunKilic avatar Apr 29 '24 13:04 HarunKilic

Must be, can you check if this cookie is being set correctly https://github.com/amalshaji/portr/blob/23dbede7c7fc7d49d54467ec1d9df5da0e8c5c20/admin/src/portr_admin/apis/v1/auth.py#L55-L57

amalshaji avatar Apr 29 '24 13:04 amalshaji

Yea, there is two cookies: image

HarunKilic avatar Apr 29 '24 13:04 HarunKilic

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

amalshaji avatar May 01 '24 07:05 amalshaji