Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions lib/userbackend.php → lib/UserBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,7 @@ public function createUserIfNotExists($uid) {
*/
public function implementsActions($actions) {
$availableActions = \OC\User\Backend::CHECK_PASSWORD;
if($this->autoprovisionAllowed()
&& $this->config->getAppValue('user_saml', 'saml-attribute-mapping-displayName_mapping', '') !== '') {

$availableActions |= \OC\User\Backend::GET_DISPLAYNAME;
}

$availableActions |= \OC\User\Backend::GET_DISPLAYNAME;
return (bool)($availableActions & $actions);
}

Expand Down Expand Up @@ -413,7 +408,7 @@ public function registerBackends(array $backends) {
private function getAttributeValue($name, array $attributes) {
$keys = explode(' ', $this->config->getAppValue('user_saml', $name, ''));

if(count($keys) === 1 && $keys[1] === '') {
if(count($keys) === 1 && $keys[0] === '') {
throw new \InvalidArgumentException('Attribute is not configured');
}

Expand Down
1 change: 1 addition & 0 deletions tests/integration/features/Shibboleth.feature
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Feature: Shibboleth
And I should be redirected to "http://localhost/index.php/apps/files/"
Then The user value "id" should be "student1"
Then The user value "email" should be ""
And The user value "display-name" should be "Default displayname of student1"

Scenario: Authenticating using Shibboleth with SAML in provisioning mode and custom mapped attributes
Given The setting "type" is set to "saml"
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public function thUserValueShouldBe($key, $value) {
public function aLocalUserWithUidExists($uid) {
shell_exec(
sprintf(
'sudo -u apache OC_PASS=password /opt/rh/rh-php56/root/usr/bin/php %s user:add %s --password-from-env',
'sudo -u apache OC_PASS=password /opt/rh/rh-php56/root/usr/bin/php %s user:add %s --display-name "Default displayname of '.$uid.'" --password-from-env',
__DIR__ . '/../../../../../../occ',
$uid
)
Expand Down