ORCID-Source icon indicating copy to clipboard operation
ORCID-Source copied to clipboard

/me endpoint

Open asencis opened this issue 3 years ago • 5 comments

Just making a quick request if at all possible.

Could we have a /me API endpoint that takes in a user's token as Bearer auth and returns that user's object details...

asencis avatar Jan 22 '21 17:01 asencis

Hi,

We have a userinfo endpoint at https://orcid.org/oauth/userinfo that works as you expect.

Documentation can found at https://github.com/ORCID/ORCID-Source/blob/master/orcid-web/ORCID_AUTH_WITH_OPENID_CONNECT.md#other-endpoints

Hope that helps!

TomDemeranville avatar Jan 27 '21 16:01 TomDemeranville

@TomDemeranville Ah, perfect. Thanks Tom!

asencis avatar Jan 27 '21 18:01 asencis

@TomDemeranville Sorry Tom, I'm just reopening this issue. Is there any possibility that this endpoint could return an email address?

asencis avatar Jan 27 '21 20:01 asencis

97.7% of our users keep their email address private, so we didn't include it in the userinfo as it would be disappointingly empty in most cases.

TomDemeranville avatar Jan 27 '21 22:01 TomDemeranville

@TomDemeranville Could I suggest the following changes:

  • Endpoint is duplicated, for backwards compatibility, to also be accessible on 'https://orcid.org/me'
  • Endpoint returns the email / person if allowed, if not - empty email key => value (e.g., email: null).
  • Could the response match more closely with a https://api.sandbox.orcid.org/v2.0/{} call...so instead of 'sub' key, we have 'orcid' or 'id' key.

This would allow for better integration of your OAuth service with the python-social-auth module: https://github.com/python-social-auth/social-core/blob/master/social_core/backends/orcid.py via RESTful API service.

asencis avatar Jan 28 '21 10:01 asencis

Hi, thanks for the suggestions. We will look at them in 2023 when we're also looking at PKCE.

TomDemeranville avatar Nov 28 '22 16:11 TomDemeranville