-
Notifications
You must be signed in to change notification settings - Fork 19
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 session token creation "remember" parameter #51
Conversation
…rd by the Session class Signed-off-by: Julien Veyssier <[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.
Makes sense
Maybe I'm confused. But we have two different flags for tokens. Temporary/permanent and remember-me. Temporary/permanent lets us distinguish between browser sessions (temporary token that expires) and app passwords (they don't expire). The remember/do-not-remember flag is only used for session tokens. We default to So I'm wondering if nextcloud/server#24552 was possibly wrong. I think we should set the app_password session var when (there is no |
Sounds right to only set the session value when using a permanent token. Tough I'd still think that using a remember me token might be expected behaviour (as with a regular login) also when logging in through the global site selector. |
@ChristophWurst Do you agree with @juliushaertl 's comment? I mean, does it still make sense to create a remember_me token when logging in via the GSS even if we fix Here is a PR for what you suggested: nextcloud/server#29729 |
* Create app passwords: [Ticket#9623982] nextcloud/globalsiteselector#51 * Create email templates using variables set in config.php: https://github.com/SUNET/drive-email-template * Add custom button on direct login page: https://github.com/SUNET/loginpagebutton/
/backport to stable1 |
When the slave controller creates the session token on login, the
remember
parameter is set toIToken::DO_NOT_REMEMBER
.This has a visible negative side effect: It is impossible to create an app password (in the web UI) after having logged in via GSS because
OC\User\Session
becauseapp_password
is set in the session in this case.https://github.com/nextcloud/server/blob/582234322a59e32fd0d220023a260b66a9b205f2/lib/private/User/Session.php#L850-L854
As it is expected to prevent app password creation when authenticated with an app password, I think it should be possible when logging in via GSS.
I don't know if this is an acceptable fix and if it has bad side effects but it solves the app password generation issue.