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

API: add endpoint for listing users #3009

Closed
pdurbin opened this issue Mar 9, 2016 · 4 comments
Closed

API: add endpoint for listing users #3009

pdurbin opened this issue Mar 9, 2016 · 4 comments

Comments

@pdurbin
Copy link
Member

pdurbin commented Mar 9, 2016

In chat yesterday we discussed adding an API for listing users. Technically, I already stubbed something out in 7ea6a01 but in a standup meeting this morning I advocated to make it more real, especially so I can explain how to list users before attempting to convert one from being a Shibboleth user to being a local/builtin user (#2915). I'm playing around with what the JSON would look like and I'm thinking of something along these lines:

{
  "id": 1,
  "identifier": "@dataverseAdmin",
  "displayName": "Dataverse Admin",
  "firstName": "Dataverse",
  "lastName": "Admin",
  "email": "dataverse@mailinator.com",
  "superuser": true,
  "affiliation": "Dataverse.org",
  "position": "Admin",
  "persistentUserId": "dataverseAdmin",
  "authenticationProviderId": "builtin"
},
{
  "id": 9,
  "identifier": "@aiden.cook",
  "displayName": "Aiden Cook",
  "firstName": "Aiden",
  "lastName": "Cook",
  "email": "aiden.cook@example.com",
  "superuser": false,
  "persistentUserId": "https://idp.example.com/idp/shibboleth|5e97f768",
  "authenticationProviderId": "shib"
}
@pdurbin pdurbin self-assigned this Mar 9, 2016
pdurbin added a commit that referenced this issue Mar 9, 2016
Having this endpoint makes documenting the conversion from Shib to
builtin for #2915 easier.
@pameyer
Copy link
Contributor

pameyer commented Mar 9, 2016

@pdurbin - is the "@" coming from the export, or something that's part of the identifiers in your test set?

aka - "@dataverseAdmin" vs "dataverseAdmin"?

@pdurbin
Copy link
Member Author

pdurbin commented Mar 9, 2016

@pameyer it's sort of a long story. See #1151 #1445 #1705 and probably other issues. The answer to your specific question is that authenticatedUser.getIdentifier() adds the @ sign. The @ sign isn't in the authenticateduser table.

Otherwise, I hope the data returned looks ok and useful. I did go ahead and push 0b212f8 which is the code I was playing with to dump the JSON above.

@pdurbin
Copy link
Member Author

pdurbin commented Mar 18, 2016

Passing to QA. The new API endpoint is documented as curl -H "X-Dataverse-key: $API_TOKEN" http://localhost:8080/api/admin/authenticatedUsers at http://guides.dataverse.org/en/2939-shib/installation/shibboleth.html#converting-shibboleth-users-to-local and shows JSON as described in the first comment/description above. This feature is in pull request #3025.

@pdurbin pdurbin assigned kcondon and unassigned pdurbin Mar 18, 2016
@kcondon
Copy link
Contributor

kcondon commented Mar 29, 2016

OK, works, closing.

@kcondon kcondon closed this as completed Mar 29, 2016
@pdurbin pdurbin added this to the 4.4 milestone Jun 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
@pdurbin @kcondon @pameyer and others