zorn-v / nextcloud-social-login

GNU Affero General Public License v3.0
198 stars 137 forks source link

feat: populate userprofile again if no identifier #281

Closed rtdany10 closed 3 years ago

rtdany10 commented 3 years ago

A second level check to verify if identifier exists. If not, we populate the whole userProfile with data received from OpenID Connect profile endpoint.

Fixes issues like #275

zorn-v commented 3 years ago

$userProfile->identifier = $profile->get('sub'); should be enough. Thanks.

zorn-v commented 3 years ago

Check v4.6.9 Thanks again for investigation.

rtdany10 commented 3 years ago

$userProfile->identifier = $profile->get('sub'); should be enough. Thanks.

I would love to agree, but in the issue I raised, I was getting wrong values for name, email etc. So, if we don't repopulate it, it would be having wrong values.

$userData = $this->getStoredData('user_data'); was bringing in values of "Guest" user. And hence, repopulating was necessary for me.

zorn-v commented 3 years ago

Well, now I think data from "user info" endpoint should be preferred to id_token (as I thinked before). So I just remove checks like "if not empty"

zorn-v commented 3 years ago

Check v4.6.10 then )

rtdany10 commented 3 years ago

Well, now I think data from "user info" endpoint should be preferred to id_token (as I thinked before). So I just remove checks like "if not empty"

Yes, that could also work :) Thanks.