-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Allow SSO authentication to provide a user secret #27929
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Implementing PR #24837 from immerda Signed-off-by: MichaIng <[email protected]>
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,41 @@ | ||||||
| <?php | ||||||
| /** | ||||||
| * @copyright Copyright (c) 2021, MichaIng <[email protected]> | ||||||
| * | ||||||
| * @author MichaIng <[email protected]> | ||||||
| * | ||||||
| * @license AGPL-3.0 | ||||||
| * | ||||||
| * This code is free software: you can redistribute it and/or modify | ||||||
| * it under the terms of the GNU Affero General Public License, version 3, | ||||||
| * as published by the Free Software Foundation. | ||||||
| * | ||||||
| * This program is distributed in the hope that it will be useful, | ||||||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||||
| * GNU Affero General Public License for more details. | ||||||
| * | ||||||
| * You should have received a copy of the GNU Affero General Public License, version 3, | ||||||
| * along with this program. If not, see <http://www.gnu.org/licenses/> | ||||||
| * | ||||||
| */ | ||||||
| // use OCP namespace for all classes that are considered public. | ||||||
| // This means that they should be used by apps instead of the internal ownCloud classes | ||||||
|
|
||||||
| namespace OCP\Authentication; | ||||||
|
|
||||||
| /** | ||||||
| * Interface IProvideUserSecretBackend | ||||||
| * | ||||||
| * @since 23.0.0 | ||||||
| */ | ||||||
| interface IProvideUserSecretBackend { | ||||||
|
|
||||||
| /** | ||||||
| * Optionally returns a stable per-user secret. This secret is for | ||||||
| * instance used to secure file encryption keys. | ||||||
| * @return string | ||||||
| * @since 23.0.0 | ||||||
| */ | ||||||
| public function getCurrentUserSecret(): string; | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would making this nullable make sense? Especially as
Suggested change
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the idea was to explicitly not allow a null value here, so that checks can be omitted when the interface is implemented. Backends then need to always provide a string. Ref: #27929 (comment) But I see this is inconsistent with the description "Optionally returns a stable per-user secret.", which just has not been changed when I copy&pasted it from
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I suggested to introduce the non-nullable return value earlier. To me it seems more reasonable as the user secret would be used for the user key encryption where I'd argue that if a backend provides user secrets there should be always one set for the user.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Two comments/issues:
Any thoughts? I have a local Keycloak -> NC dev setup working, and I'm happy to test.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Is it possible that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have a proposal to get us unstuck here. How about we make This would allow us to disentangle the two problems, preserve the identical behavior for the non-userSecret case and let
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't it exactly the same outcome whether passing The main question is indeed whether we want to be more explicit and force usage of a password when the backend is implemented or whether we want to allow implementing the backend without the need to provide a password. Generally I'm fans of being more explicit, but I understand that it may make the backend implementation more complicated. I think it is agreed that we can or even should merge this PR first, before doing so at the backend, especially since the interfaces are defined here, so the above is really the last open question. I think we need someone who is more in charge to simply do a decision and we'll be able to deal with the result. But we need to get unstuck 😄. |
||||||
| } | ||||||
Uh oh!
There was an error while loading. Please reload this page.