-
Notifications
You must be signed in to change notification settings - Fork 39
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
Fix password confirmation #1061
base: main
Are you sure you want to change the base?
Conversation
…whenever the user ID is obtained from the user backend Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
…TION to true to prevent password validation Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
Just for confirmation, |
@waza-ari It is internal to the server. Nothing that the users or the admins should be aware of. |
34615e6
to
b0b5588
Compare
run cs:fix Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
b0b5588
to
f1f7992
Compare
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.
One thing to double check
// prevent password confirmation | ||
if (defined(IToken::class . '::SCOPE_SKIP_PASSWORD_VALIDATION')) { | ||
$token = $this->authTokenProvider->getToken($this->session->getId()); | ||
$token->setScope([IToken::SCOPE_SKIP_PASSWORD_VALIDATION => true]); |
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.
IIRC, if another scope was set, it needs to be taken over, this would replace it.
refs nextcloud/server#43612
last-password-confirm
in the session everytime the user ID is obtained inOCA\UserOIDC\User\Backend::getCurrentUserId()
OCP\Authentication\Token\IToken
IToken::SCOPE_SKIP_PASSWORD_VALIDATION
is defined (it was introduced in 30)Maybe 1. is not necessary. Wdyt?