mirror of
https://github.com/glenndehaan/unifi-voucher-site.git
synced 2026-05-09 08:25:29 +02:00
[GH-ISSUE #51] Getting 502 after login via OpenID (Authentik) #22
Labels
No labels
bug
enhancement
pull-request
question
question
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/unifi-voucher-site#22
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @tomcatcw1980 on GitHub (Nov 1, 2024).
Original GitHub issue: https://github.com/glenndehaan/unifi-voucher-site/issues/51
Originally assigned to: @glenndehaan on GitHub.
The question
Hi Glenn,
still loving your app. As I see you implemented OpenID. Thanx for that.
I installed the feature immediately, but after successfully logging in via Authentik I get a 502 Bad Gateway Error. When I press F5 again to refresh the web page, it shows me the following error:
BadRequestError: invalid_grant (The provided authorization grant or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client) at ResponseContext.callback (/app/node_modules/express-openid-connect/lib/context.js:366:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) Go back homeDo you have an idea of what's going wrong? I set everything as mentioned in your docs.
Greetings
Christian
@glenndehaan commented on GitHub (Nov 1, 2024):
Hi @tomcatcw1980,
Could you post the version of both Authentik and UniFi Voucher Site. The thing is, there where a lot of breaking changes and I want to make sure I can replicate your issue locally.
Kind regards,
Glenn
@tomcatcw1980 commented on GitHub (Nov 1, 2024):
Hi Glenn,
Voucher Site latest: 4.3.3
Authentik: 2024.8.3
Greetings
@glenndehaan commented on GitHub (Nov 1, 2024):
Hi @tomcatcw1980,
I have some bad news. I just setup a local instance with this version and followed the guide and it seems to be working fine. So i'm unsure where the problem may be. Can you verify the steps and make sure the client id and secret are correct?
@glenndehaan commented on GitHub (Jan 4, 2025):
Hi @tomcatcw1980,
Where you able to verify the above ?
@tomcatcw1980 commented on GitHub (Jan 5, 2025):
Hi Glenn,
sorry still getting the same error "bad gateway". Check everything multiple times but no luck.
greetings.
error message from voucher app
BadRequestError: checks.state argument is missing at ResponseContext.callback (/app/node_modules/express-openid-connect/lib/context.js:366:15)@glenndehaan commented on GitHub (Jan 5, 2025):
That sounds very strange. I have also never seen that error before, almost leaves me to believe the request is missing the entire state back from authentik. If you want and have time we could jump on a call to see if we can figure this out?
@YouKyi commented on GitHub (Jan 6, 2025):
Hey!
i have the same issue :/
EDIT :
I recreate the docker stack and the Authentik configuration from scratch -> Always 502 and when refreshed I have this error
Maybe because I use a NPM reverse proxy?
@glenndehaan commented on GitHub (Jan 7, 2025):
Hi @YouKyi,
So I tried setting it up again from scratch to test.
But I don't get the error you see.
To recap what I did, I followed these steps to get Authentik going locally: https://docs.goauthentik.io/docs/install-config/install/docker-compose
I then proceeded following my own guide: https://github.com/glenndehaan/unifi-voucher-site/blob/master/.docs/oidc/authentik/README.md
I run it locally without Proxy so my network looks like this:
I then configured UniFi Voucher site with the following configuration:
I then restart UniFi Voucher Site and here is what the flow looks like when trying to login:
The error you get could be a couple of things:
I also don't understand where your flow now stops. Is it on first page load? Or is it when you click sign in with OpenID Connect?
@glenndehaan commented on GitHub (Jan 7, 2025):
So small update I also tried is over an ngrok proxy/tunnel:
Where there is even a mixed http/https environment this also works. So i'm almost convinced it must be a configuration error.
@YouKyi commented on GitHub (Jan 8, 2025):
I'll try again at another time.
A configuration error is likely, but I have 30 or so OIDC SSO applications, so I know how to configure pretty well...:/
Nevertheless, I'm using proxy configuration
I'll keep you posted :)
@tomcatcw1980 commented on GitHub (Jan 8, 2025):
Hi Glenn,
same to me. I use a reverse proxy (nginx proxy manager). I think this could be the problem. Like YouKyi this ist not my first oidc config with Authentik and others work perfectly.
Thank you for your support.
greetings.
@glenndehaan commented on GitHub (Jan 8, 2025):
Hi @YouKyi and @tomcatcw1980,
I get both points but my problem is that currently I can't replicate it. And with all my testing even over different proxy's I don't have the issue.
I'm never going to fully replicate the environment that you both have running. So my only way to debug would be to plan a screenshare session so I can have a look. Because it's not feasable for me to fully replicate the entire environment, I have tried that to the best of my abilities.
@glenndehaan commented on GitHub (Jan 21, 2025):
Closing this stale issue
@YouKyi commented on GitHub (Mar 10, 2025):
Hello,
Without any modifications, it's work now!
Have a nice day,