goauthentik / authentik

The authentication glue you need.
https://goauthentik.io
Other
8.14k stars 634 forks source link

Authentik + Roundcube + Dovecot - 404 page on webmail after successful authentication on Authentik #8306

Closed LeftoversTodayAppAdmin closed 4 days ago

LeftoversTodayAppAdmin commented 6 months ago

Describe the bug

I am using Authentik to build SSO with Roundcube + Dovecot but I get a 404 page on webmail after successful authentication on Authentik. Direct authentication to the web server has no issues. Authentik is also working really well with Rocket.chat

To Reproduce Steps to reproduce the behavior:

I can provide access to my test setup.

Expected behavior After auth the redirect opens the inbox on iRedmail

Screenshots Its just a nginx 404 page with this URL: https://mail.mydomain.com/index.php/login/oauth?code=31e7ce7051194543906e6fe2ebda58c8&state=G3qhnBAQz7sT

Logs Roundcube logs: Jan 25 07:23:13 mail roundcube: <83b3gt0f> IMAP Error: Login failed for support@leftovers.today against 127.0.0.1 from 97.126.115.237. AUTHENTICATE LOGIN: A0002 NO [AUTHENTICATIONFAILED] Authentication failed. in /opt/www/roundcubemail-1.6.5/program/lib/Roundcube/rcube_imap.php on line 211 (POST /?_task=login&_action=login) Jan 25 07:23:14 mail roundcube: <83b3gt0f> Failed login for support@leftovers.today from 97.126.115.237 in session 83b3gt0f8leaq23f (error: 0)

Nothing in the dovecot logs

Version and Deployment (please complete the following information):

Additional context Add any other context about the problem here.

MaximalCats commented 5 months ago

Having the same issue - any fix for it yet?

Atomique commented 5 months ago

Also having an issue that seems like this one. I get an error while authenticating to gitlab and seafile. Worked before my update.

MaximalCats commented 5 months ago

I seemed to have found a fix for this; i forgot where or what i did however. It had something to do with the way how nginx finds php files. Here is my nginx config.

If i remember correctly, i think i changed the regex value which nginx uses to find php files to: [^/]\.php(/|$). If any issues arise, i unfortunately can't help. I have switched to Caddy, and my knowledge of nginx is very limited.

Leatherface75 commented 4 months ago

For me the problem seems to be in dovecot. Have tried everything can't get this to work.

Mar 23 20:32:48 auth-worker(65471): Info: conn unix:auth-worker (pid=59652,uid=302): auth-worker<4>: pam(xxxxxxxx,::1,<em8AzkVUkcoAAAAAAAAAAAAAAAAAAAAB>): pam_authenticate() failed: Authentication failure (Password mismatch?) Mar 23 20:32:48 auth: Info: oauth2(xxxxxx,::1,<em8AzkVUkcoAAAAAAAAAAAAAAAAAAAAB>): oauth2 failed: Introspection failed: Username 'xxxxxxx' did not match 'xxxxxxx@xxxxxxx.xxx'

This with all settings as the guide says.

authentik-automation[bot] commented 2 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

authentik-automation[bot] commented 1 week ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Leatherface75 commented 4 days ago

Any news? Still can't get this working.