-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
First OAuth authentication forwards to Mailcow backend instead of target URL #6161
Comments
I can't confirm, I'm using the same setup and it works like a charm as before. |
Confirm |
Actually, i don't think this is a mailcow problem as we did not changed anything here which is live in the master branch which could explain this, as the changes regarding OIDC/LDAP are not live yet. I would speculate it is a change from nextcloud which is causing this thing to stopped working... can someone confirm that? |
I'm having the same issue. I rather suspect a bug in mailcow, because nextcloud correctly redirects to the mailcow authorize login mask. If you log in there, however, you end up in the mailcow interface instead of in the ‘authorise application’ dialogue. I don't see how an OAuth2 application should trigger such behaviour. Either mailcow recognises that you want to do OAuth2 login and shows the corresponding login mask (which it does) or not (i.e. regular login mask). Before mailcow redirects back to nextcloud, nextcloud should have no influence on the login process within mailcow. |
@DerLinkman I tend to agree that it is on the Nextcloud Social Login app. I had opened an issue there zorn-v/nextcloud-social-login#489 as well. It can well be on their side if forward URLs are not properly transmitted to mailcow OAuth provider. @heavygale @ashkov Please comment on the Nextcloud Social Login GitHub issue as well, so far no activity there on my posted issue. Thanks all for your reactions. I will make sure to close this issue when we see it is a Nextcloud topic. |
But how could the login succeed on retry (when already logged in to mailcow), if nextcloud doesn't provide the correct URLs? And if there's a parameter missing in the call, shoudn't mailcow display a corresponding error message? |
I'm experiencing this without nextcloud, in custom integration with django_allauth module. It seem that I send authorize request as usual do in any other OAuth apps. |
Strange. I am using Nextcloud (30.0.2) as well as Authentik with oauth and both are working with no issues whatsoever with mailcow's latest release as IDP. |
Hello, After a deeper investigation, we didnt find any bug or solution within the mentioned apps, so we also assume a bug in mailcow. After logging in via OAuth2, Mailcow returns a 302 Found with a Location Response header to /user. |
@DerLinkman So the actual, problematic redirect happens here: https://github.com/mailcow/mailcow-dockerized/blob/master/data/web/inc/triggers.inc.php#L114 Actually this line was changed in 2018 for the last time, so i guess there is no relation. The line after that was changed in august this year for the last time in this commit, which looks more conspicuous to me. But i am not sure, whether this is the exact reason why this happens. |
Indeed, removing the new "die();" line restores the previous behavior and the user is correctly redirected to /oauth/authorize again. |
I can reproduce this. But i am unsure, which side effects will happen, if this die() statement will be removed permanently. I assume, that it wasnt placed without a reason at this point. May you can tell us more about this change, @FreddleSpl0it? |
Actually not, because you are not directly redirected to the service provider (e.g. Nextcloud, GitLab, ...). Mailcow will show you the authorize page first, so actually the mentioned override must remove(?) the Location header again. I also dont really get, what happening there. |
Yes, i meant the mailcow internal redirect from the login page to the authorize page (/oauth/authorize[...]), instead of /user. |
Contribution guidelines
I've found a bug and checked that ...
Description
Logs:
Steps to reproduce:
Which branch are you using?
master
Which architecture are you using?
x86
Operating System:
Ubuntu 22.04
Server/VM specifications:
16GB, 4 cores
Is Apparmor, SELinux or similar active?
no
Virtualization technology:
not sure
Docker version:
not sure
docker-compose version or docker compose version:
not sure
mailcow version:
most recent official
Reverse proxy:
Apache2
Logs of git diff:
Logs of iptables -L -vn:
Logs of ip6tables -L -vn:
Logs of iptables -L -vn -t nat:
Logs of ip6tables -L -vn -t nat:
DNS check:
The text was updated successfully, but these errors were encountered: