Roundcube Community Forum

 

Authentication via Authelia oauth

Started by rentry, January 07, 2025, 11:12:11 AM

Previous topic - Next topic

rentry

Hello!

¿Has anyone succesfully configured the authentication using Authelia?

I have followed the doc and done some research finding this resources:
- https://github.com/authelia/authelia/blob/master/docs/content/integration/openid-connect/roundcube/index.md
- https://github.com/authelia/authelia/discussions/7048

But its not working.
I have configured it this way:

Roundcube:

$config['oauth_provider'] = 'generic';
$config['oauth_provider_name'] = 'MyAuthelia';
$config['oauth_client_id'] = "roundcube";
$config['oauth_client_secret'] = "*************";
$config['oauth_auth_uri'] = "https://myauthelia.mydomain.com/api/oidc/authorize";
$config['oauth_token_uri'] = "https://myauthelia.mydomain.com/api/oidc/token";
$config['oauth_identity_uri'] = 'https://myauthelia.mydomain.com/api/oidc/userinfo';
$config['oauth_identity_fields'] = ['mail'];
$config['oauth_scope'] = "email profile openid";


Authelia:

identity_providers:
  oidc:
    jwks:
      - key: |
          -----BEGIN RSA PRIVATE KEY-----
          ************************************
          -----END RSA PRIVATE KEY-----

    clients:
      - client_id: 'roundcube'
        client_name: 'RoundcubeAuth via MyAuthelia'
        client_secret: '***********'
        authorization_policy: 'one_factor'
        redirect_uris:
          - 'https://myroundcube.mydomain.com/index.php/login/oauth'
        scopes:
          - 'openid'
          - 'profile'
          - 'email'
        userinfo_signed_response_alg: 'none'
        token_endpoint_auth_method: 'client_secret_post'


Roundcube shows the button to login via authelia,


then the authelia login is shown and succesfully done...



 and after that, instead of logging to roundcube or show any error, the roundcube form is shown again this way:


I dont see any errors in the logs, just the accesses with 200 status code.
I have succesfully configured another application using my authelia deployment, but still no luck with Roundcube.

Could you please help me?

Thanks!