Skip to content
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

Refine password element for user import (and possibly export) #3462

Closed
asmecher opened this issue Mar 8, 2018 · 11 comments
Closed

Refine password element for user import (and possibly export) #3462

asmecher opened this issue Mar 8, 2018 · 11 comments
Assignees
Milestone

Comments

@asmecher
Copy link
Member

asmecher commented Mar 8, 2018

Currently there's no way to import users specifying plain-text passwords.

lib/pkp/plugins/importexport/users/pkp-users.xsd specifies an encryption attribute, but lib/pkp/plugins/importexport/users/filter/UserXmlPKPUserFilter.inc.php doesn't refer to it.

Refine the password element (and attributes) to allow clearer import/export of password data, including plain-text password imports.

@asmecher
Copy link
Member Author

asmecher commented Mar 8, 2018

This is related to #3261, so assigning to you, @defstat. No milestone assigned yet.

@defstat
Copy link
Contributor

defstat commented Mar 16, 2018

@asmecher
The user export function exports a password hash and its encryption (as given in config.inc.php)
The user import function seems to set the user password as given from the exported xml hashed password (indeed not taking into account the encryption algorithm).

I suppose that the first thing here is to check on import the password_needs_rehash for the db hash.

  • If false, the password hash can be inserted in the user row
  • If true, we could create a reset-password-hash, and add the user as if the user asked for a password reset. (not sure if that's a "valid" approach)

@asmecher Is there a case where the user can specify a plain-text password (in OJS)? Or you are referring to an XML that is not produced from export process? If yes we can omit the encryption attribute from XML, and then follow the target's (import OJS) encrypt process on the plain-password text.

Any thoughts on these?

@asmecher
Copy link
Member Author

The use case for plain-text imports is when creating content for OJS from another system. What you're proposing makes sense.

defstat added a commit to defstat/pkp-lib that referenced this issue Mar 19, 2018
@defstat
Copy link
Contributor

defstat commented Mar 19, 2018

@asmecher
I prepared a PR that adds the following to the import process

  • Plain-text password import: If the imported XML element does not define an encryption attribute, then the function encrypts the value of the element, supposing that its a plain-text password. (No checks are performed - for example - for the length of the password.)
  • Import of passwords that the password_needs_rehash return true: a new random password is being created and the proper email is being send to the imported user (as if the user is being registered with a random password). The change_password switch is turned on for this user.
  • Import of passwords that the password_needs_rehash return false: The password is just imported to the user as-is.

PR
pkp-lib: #3494

defstat added a commit to defstat/pkp-lib that referenced this issue Apr 22, 2018
defstat added a commit to defstat/pkp-lib that referenced this issue Apr 30, 2018
defstat added a commit to defstat/pkp-lib that referenced this issue Apr 30, 2018
defstat added a commit to defstat/pkp-lib that referenced this issue Apr 30, 2018
defstat added a commit to defstat/pkp-lib that referenced this issue Apr 30, 2018
defstat added a commit to defstat/pkp-lib that referenced this issue May 6, 2018
defstat added a commit to defstat/pkp-lib that referenced this issue May 6, 2018
defstat added a commit to defstat/pkp-lib that referenced this issue May 6, 2018
defstat added a commit to defstat/ojs that referenced this issue May 6, 2018
defstat added a commit to defstat/ojs that referenced this issue May 6, 2018
defstat added a commit to defstat/pkp-lib that referenced this issue May 6, 2018
defstat added a commit to defstat/omp that referenced this issue May 6, 2018
defstat added a commit to defstat/ojs that referenced this issue May 6, 2018
@defstat
Copy link
Contributor

defstat commented May 6, 2018

@asmecher
Some review changes to pkp-lib and changes to OMP and OJS master branch
PRs
pkp-lib: #3494
ojs: pkp/ojs#1954
omp: pkp/omp#529

@asmecher
Copy link
Member Author

asmecher commented May 8, 2018

Thanks, @defstat, just one remaining comment!

defstat added a commit to defstat/pkp-lib that referenced this issue May 10, 2018
defstat added a commit to defstat/pkp-lib that referenced this issue May 10, 2018
defstat added a commit to defstat/pkp-lib that referenced this issue May 10, 2018
defstat added a commit to defstat/pkp-lib that referenced this issue May 10, 2018
defstat added a commit to defstat/pkp-lib that referenced this issue May 10, 2018
defstat added a commit to defstat/pkp-lib that referenced this issue May 10, 2018
defstat added a commit to defstat/ojs that referenced this issue May 10, 2018
defstat added a commit to defstat/ojs that referenced this issue May 10, 2018
defstat added a commit to defstat/ojs that referenced this issue May 10, 2018
defstat added a commit to defstat/pkp-lib that referenced this issue May 30, 2018
defstat added a commit to defstat/pkp-lib that referenced this issue May 30, 2018
defstat added a commit to defstat/ojs that referenced this issue May 30, 2018
defstat added a commit to defstat/ojs that referenced this issue May 30, 2018
defstat added a commit to defstat/ojs that referenced this issue May 30, 2018
defstat added a commit to defstat/ojs that referenced this issue May 30, 2018
defstat added a commit to defstat/omp that referenced this issue May 30, 2018
defstat added a commit to defstat/ojs that referenced this issue May 31, 2018
defstat added a commit to defstat/ojs that referenced this issue May 31, 2018
defstat added a commit to defstat/ojs that referenced this issue May 31, 2018
defstat added a commit to defstat/ojs that referenced this issue May 31, 2018
@defstat
Copy link
Contributor

defstat commented May 31, 2018

@asmecher Everything merged

@asmecher
Copy link
Member Author

Thanks, @defstat! Closing this issue.

@asmecher asmecher added this to the OJS/OMP 3.2 milestone May 31, 2018
ppv1979 pushed a commit to ppv1979/pkp-lib that referenced this issue Jun 3, 2018
asmecher added a commit that referenced this issue Jun 4, 2018
lilients pushed a commit to lilients/omp that referenced this issue Sep 25, 2018
…ord-element

[OMP] #3462 Refine password element for user import (and possibly export)
@asmecher asmecher modified the milestones: OJS/OMP 3.2, OJS/OMP 3.1.2 Dec 21, 2018
@defstat
Copy link
Contributor

defstat commented Sep 30, 2019

@defstat defstat reopened this Sep 30, 2019
@NateWr
Copy link
Contributor

NateWr commented Dec 16, 2021

@defstat if this is still a problem, can you file a new issue for it? Then we can scheduled it against a future milestone.

@NateWr NateWr closed this as completed Dec 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants