Skip to content

Conversation

@LukasReschke
Copy link
Member

\OC_User::loginWithApache is used in combination with backend mechanisms like our SSO / SAML integration. Those can optionally already provide a displayname using other means. For example by mapping SAML attributes.

The current approach makes it however impossible for backends using \OCP\Authentication\IApacheBackend to set a displayname on their own. Because the display name will simply be overwritten with the loginname.

Signed-off-by: Lukas Reschke [email protected]

@LukasReschke LukasReschke added the 3. to review Waiting for reviews label Feb 16, 2017
@LukasReschke LukasReschke added this to the Nextcloud 12.0 milestone Feb 16, 2017
@LukasReschke
Copy link
Member Author

The SAML app will have integration tests for this. Am currently working on it at https://github.com/nextcloud/user_saml/compare/attributes-to-map-for.

Copy link
Member

@blizzz blizzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has potential

if (self::getUser() !== $uid) {
self::setUserId($uid);
self::setDisplayName($uid);
$setDisplayName = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var name is not very clear. My suggestion is to rename to "setUidAsDisplayName" or "useUidAsDisplayName"

&& $backend->implementsActions(OC_User_Backend::GET_DISPLAYNAME)) {

$backendDisplayName = $backend->getDisplayName($uid);
if(is_string($backendDisplayName) && $backendDisplayName !== '') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trim($backendDisplayName) !== '', just in case?

`\OC_User::loginWithApache` is used in combination with backend mechanisms like our SSO / SAML integration. Those can optionally already provide a displayname using other means. For example by mapping SAML attributes.

The current approach makes it however impossible for backends using `\OCP\Authentication\IApacheBackend` to set a displayname on their own. Because the display name will simply be overwritten with the loginname.

Signed-off-by: Lukas Reschke <[email protected]>
@LukasReschke LukasReschke force-pushed the if-backend-implements-get-display-name-dont-force-one branch from 3dd6379 to 92c74d2 Compare February 16, 2017 12:55
@LukasReschke
Copy link
Member Author

@blizzz Adjusted 😉

@LukasReschke LukasReschke added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Feb 16, 2017
@LukasReschke LukasReschke merged commit cdc48d3 into master Feb 16, 2017
@LukasReschke LukasReschke deleted the if-backend-implements-get-display-name-dont-force-one branch February 16, 2017 13:20
@linuxrrze
Copy link

linuxrrze commented Feb 17, 2017

Just tested the patch with git latest (server+user_saml) - works as expected.
(user_saml: "type": "environment-variable")

2 side notes:

  • In the "Personal" view, "Full name" still displays the login name (I'd expect the displayName here) - this may however not be a user_saml topic.
  • When using user_saml "environment-variable" type, and you modify "SSO & SAML authentication" settings
    (e.g. REMOTE_USER) via web frontend (not occ) the "type" gets reset to "saml" (and breaks the setup)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to release Ready to be released and/or waiting for tests to finish

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants