Skip to content

Conversation

@rzmf
Copy link

@rzmf rzmf commented Dec 23, 2016

No description provided.

*/
private function autoprovisionIfPossible(array $auth) {
$uidMapping = $this->config->getAppValue('user_saml', 'general-uid_mapping');
$displayName = $auth['urn:oid:2.5.4.42'][0] . ' ' . $auth['urn:oid:1.2.40.0.10.2.1.1.261.20'][0];
Copy link
Member

Choose a reason for hiding this comment

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

From my understanding those should be configurable values – right?

Copy link
Author

Choose a reason for hiding this comment

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

good point.
Two values like displayname.firstpart, displayname.secondpart to leave the admin a choice if first,last or last,first?

private function autoprovisionIfPossible(array $auth) {
$uidMapping = $this->config->getAppValue('user_saml', 'general-uid_mapping');
$displaynamefirstpartMapping = $this->config->getAppValue('user_saml','general-displaynamefirstpart_mapping');
$displaynamesecondpartMapping = $this->config->getAppValue('user_saml','general-displaynamesecondpart_mapping');
Copy link
Member

Choose a reason for hiding this comment

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

I personally would prefer to not separate between first name and second name here. Rather just a single input field that can take multiple fields. (such as {{fieldBar}} {{fieldFoo}})

If you can give me commit access to your fork I can try to come up with something like that later.

Copy link
Author

Choose a reason for hiding this comment

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

I gave you commit Access (i hope...)

Copy link
Member

@LukasReschke LukasReschke Jan 4, 2017

Choose a reason for hiding this comment

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

Yes. I just finished the automated integration test suite for Shibboleth. I'll see if I can find some time to dig into this here. :) – But I'm pretty busy at the moment with a lot of other stuff…

Copy link
Author

Choose a reason for hiding this comment

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

btw: already got mailadress working, not ready for commit yet....

Copy link
Contributor

Choose a reason for hiding this comment

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

Any update on this mailaddress item? I am storing the mail address(preferences database, as email configkey for given uid, like LDAP is doing this too), but it is not shown in the users personal page. Also, i have configured the displayname and its shown in the upper right side of the WebUI, but also not on the personal page. Somewhat strange.

Copy link
Author

Choose a reason for hiding this comment

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

Displayname works for me everywhere: upper right side, personal page, search field for sharing items.

regarding mailaddress: i have not found time to implement this better.

My current solution is: writing the email the moment the user gets created, no update, no changes:

SAMLController.php

$mailMapping = "urn:oid:0.9.2342.19200300.100.1.3";

                $mail='';
                if(isset($auth[$mailMapping])) {
                        if(is_array($auth[$mailMapping])) {
                                $mail = $auth[$mailMapping][0];
                        } else {
                                $mail = $auth[$mailMapping];
                        }
                }`

if(!$userExists && !$autoProvisioningAllowed) {
                                throw new NoUserFoundException();
                        } elseif(!$userExists && $autoProvisioningAllowed) {
                                $this->userBackend->createUserIfNotExists($uid,$displayName);
                                $user = $this->userManager->get($uid);
                                error_log("set email");
                                if (!is_null($user)) {
                                        $user->setEMailAddress($mail);
                                }
                                error_log("set email");
                                return;
                        }

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you very much for your response!

@bne86
Copy link
Contributor

bne86 commented Feb 14, 2017

Hi,
i was able to implement displayname and email mapping, they show up in a updated database schema.
But, beside of the fact that i extract a displayname and email from the SAML response, i can not see them in the WebUI and it looks like getDisplayName with some debug output is never called.

Any hints?

@LukasReschke
Copy link
Member

@bne86 From the look at your code I'd say this is because your backend doesn't define https://github.com/nextcloud/user_saml/pull/61/files#diff-eec818f31669ac6d6b4d1161cc38794bR113

@bne86
Copy link
Contributor

bne86 commented Feb 15, 2017

Thanks for the pointer, now i am getting the Log output and a error with the query that i can fix.
OC_USER_BACKEND_GET_DISPLAYNAME is deprecated, nevertheless it works and maybe i will find the corresponding not-deprecated functionality.

@LukasReschke
Copy link
Member

As discussed out-of-band with @bne86 I'll look into getting this into shape and merged into master soonish.

@LukasReschke
Copy link
Member

Let's close this in favour of #90 where I also added integration tests.

@rzmf @bne86 Can I ask you to give it a test? Any feedback appreciated. Note that you also require nextcloud/server#3507

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants