-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
Authentik OIDC redirects to invalid or localhost URL #82
Comments
Thanks for sending such a detailed report! Really helpful. I'll look at it this weekend and see if I can replicate. |
I have not been able to recreate the same issue yet but i did notice one thing thats not right. the environment variable needs to be just the domain. Faction will append the correct path: |
Thanks @summitt I still get the localhost redirect however. I'll try and dig into this a bit deeper when I have some more time |
I've been trying to debug this. I'm fairly certain it's something in faction's code as the One thing I have noticed is there are a couple stack traces in the log immediately after starting up (
Is there a way to get verbose logging from Faction that spits out all the queries it makes? |
Those stack traces are actually normal. It's related to the struts-annotation-plugin. We are working to mitigate that but it actually does not affect the application so it's been a low priority. In authentik have you tried setting the redirect URI to I have not had the time to set up Authentik and a similar deployment as you. I can confirm all these ENVs work correctly with PING Identity, AUTH0, and GOOGLE OIDC. We have this working in production on several customer sites with our hosted versions as well. Sorry, this is problematic. I'll see if we can add more logging to the OIDC comms. |
I still get the localhost:8080 redirect URL with that. Some extra debug logging would be useful, if nothing else to confirm that it's Authentik that's the issue here and not faction |
Oh! That last issue should be fixed in the most recent version. If it's not it's because I forgot to check it in. Glad you got the other issues working in docker-compose. |
Overview
I am selfhosting Faction on my cloud server and have an issue where Faction's OIDC redirection logic does not seem to redirect me to the correct callback URL.
Environement
Note all real domains have been replaced with
my.tld
and all real credentials replaced withOMITTED
for privacyhttps://auth.my.tld/application/o/faction/.well-known/openid-configuration
Error
The problem I have is with the redirect after the user has successfully authenticated to Authentik. If the configuration is identical to the above, the following error is shown after the user has authenticated to Authentik successfully:
An identical error log appears in Authentik:
This is the final URL:
https://auth.my.tld/application/o/authorize/?max_age=0&scope=openid+profile+email&display=popup&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Foauth%2Fcallback%3Fclient_name%3DOidcClient&state=0aff847c7c&code_challenge_method=S256&prompt=select_account&nonce=OMITTED&client_id=OMITTED&code_challenge=OMITTED
As you can see, the
redirect_uri
is incorrectly set to a localhost address. If I change theRedirect URIs/Origins (RegEx)
setting in Authentik to the insecure wildcard, you can see that I am redirected to an invalid localhost address:http://localhost:8080/oauth/callback?client_name=OidcClient&code=OMITTED
However, the code that I am provided is valid and I can now login to Faction if I change
http://localhost:8080
in the URL to the correcthttps://faction.internal.my.tld
. Authentik's logs also show that authentication was successful:My suspicion is that somewhere in either my Authentik or Faction settings, the
FACTION_OAUTH_CALLBACK
variable is not being honoured but I'm not 100% sure why or where. I'd appreciate a 2nd pair of eyes in discovering what I'm doing wrong. I'm also happy to send over more debugging info if it's needed. Thanks!The text was updated successfully, but these errors were encountered: