nextcloud-oidc-login icon indicating copy to clipboard operation
nextcloud-oidc-login copied to clipboard

Login filter error with webdav protocol

Open corentin-soriano opened this issue 2 years ago • 2 comments

When using realm role filtering, it doesn't work with the WebDAV protocol.

My configuration is as follows, in accordance with the documentation:

  'oidc_login_filter_allowed_values' => array('nextcloud'),
  'login_filter' => 'realm_access_roles',

My workaround is implemented in the following code snippet found in apps/oidc_login/lib/Service/LoginService.php on line 425:

$profile = json_decode(json_encode($profile), true); // 
$profile['realm_access_roles'] = $profile['realm_access']['roles'];

This is due to two factors:

  1. $profile['realm_access_roles'] is undefined.
  2. $profile is of type Object(stdClass) and not Array(), as evident in apps/oidc_login/lib/Service/AttributeMap.php:
    public function hasLoginFilter(&$profile)
    {
        return \array_key_exists($this->_login_filter, $profile);
    }

Is it possible to correct it? Thanks !

corentin-soriano avatar Sep 27 '23 15:09 corentin-soriano

Can you reproduce this in the current alpha version? https://github.com/pulsejet/nextcloud-oidc-login/releases/tag/v3.0.0-rc.2

pulsejet avatar Sep 28 '23 03:09 pulsejet

Thank you for your response. I have just installed version 3.0.0-rc2. This time, I am receiving a 401 error even before reaching getLoginFilterValues(), just like in version 2.6.0. Web authentication works perfectly in both versions. The error is only reproduced in the WebDAV protocol.

corentin-soriano avatar Sep 28 '23 16:09 corentin-soriano