-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: account info auto-update #222
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd move the account update logic into the auto provisioning service - the core change will be much less then and things belonging together will stay in the place where they belong.
besides that: THX a lot! 🙏
README.md
Outdated
// enable the user info auto-update mode | ||
'enabled' => true, | ||
// defines account attributes that will be auto-updated | ||
'attributes' => ['email', 'display-name'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using different setup for auto-provisioning and auto-update sounds really spooky.
from my pov update should use the same setup as the initial user creations - anything else seems wrong to me.
lib/Service/AccountUpdateService.php
Outdated
@@ -0,0 +1,89 @@ | |||
<?php | |||
/** | |||
* @author Thomas Müller <[email protected]> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please update
lib/Service/AccountUpdateService.php
Outdated
<?php | ||
/** | ||
* @author Thomas Müller <[email protected]> | ||
* @author Ilja Neumann <[email protected]> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
lib/Service/AccountUpdateService.php
Outdated
* @author Thomas Müller <[email protected]> | ||
* @author Ilja Neumann <[email protected]> | ||
* | ||
* @copyright Copyright (c) 2020, ownCloud GmbH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong year
@mirekys 👋 any update on this ? |
@mirekys thank you for your contribution! Can you give us this Code change under MIT license? according to @hodyroff We could skip the CLA check. Please check @DeepDiver1975 s comments, address them and get the tests passing. Coding Standard and static analyzers are complaining. |
Kudos, SonarCloud Quality Gate passed! |
This code change is made under MIT license |
I also hopefully addressed all of the change requests made by @DeepDiver1975 |
Unless I miss something: there still seems to be a different setup for the update scenario. Why would the initial provisioning use different attributes compared to the update case? Maintaining two configs is error prone for my understanding. This has already been asked for in #222 (comment) Please let me know if there are any questions or missunderstandings - thx |
I reduced and moved the configs needed for the update scenario to the following config options: https://github.com/owncloud/openidconnect/pull/222/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R130-R136 Everything should now be under an already existing Could you please point me to the code parts where it still causes misunderstandings, or maybe specify, how the configuration for this should look? Thanks a lot :) |
Config example in readme still has attributes under update. THX |
Yep, but this We could simplify it by throwing it away and saying that if the Should I move/rename the option to something else that better describes its meaning? Or does it sound better to go with the simplest solution for now and drop it? 🙂 |
Now I understand - thanks! Sorry took a while to understand. 🙈 What would be a reasonable scenario where only some attributes shall be updated? If there is none - I'd vote for removing this attributes whitelist - THX a lot |
It may make sense after the user group membership auto-update is implemented, as one may want to handle group memberships of users differently (e.g. manually/statically). In such cases preventing it from being constantly auto-updated from oidc would be desirable. But as of current implementation, I see the point that this option is unnecessary & excessive |
Kudos, SonarCloud Quality Gate passed! |
Hmm, is #278 something we overlooked here? |
WIP
Description
This PR introduces the
auto-update
mode, that updates user's account informationfrom OIDC userInfo data after successful authentication.
Related Issue
Motivation and Context
auto-provision
mode ofopenid-connect
app creates user account from OIDC claims,but after that, there is currently no way to further update account information, whenever claims coming from
an OIDC provider change over time (e. g. user changes an e-mail contact at the provider).
How Has This Been Tested?
Unit tests added for the following scenarios:
Types of changes
Bug fix (non-breaking change which fixes an issue)
New feature (non-breaking change which adds functionality)
Breaking change (fix or feature that would cause existing functionality to change)
Technical debt
Tests
Adds the new configuration section:
AccountUpdateService
(withupdateAccountInfo(IUser $user, $userInfo, bool $force = false)
AutoProvisioningService
andClient
refactored to faciliate code reuseChecklist:
Open tasks: