ORCID / python-orcid

Python wrapper around ORCID API
BSD 3-Clause "New" or "Revised" License
91 stars 26 forks source link

Add methods for webserver-based workflow #5

Closed bronger closed 8 years ago

bronger commented 8 years ago

We need the following workflow:

  1. We offer a user a link to ORCID. The user follows this link.
  2. The user logs into ORCID or registers with it.
  3. ORCID redirects to the redirect URI, which is our webserver.
  4. This webserver fetches an OAuth 2 access token.

For this workflow, I added two methods to MemberAPI.

Note that this is also possible for non-members. However, you need an app key and secret, and this is only set in the MemberAPI class. I don't know whether this is as intended or whether you plan to give the PublicAPI optional _key and _secret fields.

MSusik commented 8 years ago

Thank you for your PR! Indeed, such functionalities should appear in the library.

For the PR to be merged, some things have to be taken into account:

If you want, I can take care of that.

Note that this is also possible for non-members. However, you need an app key and secret, and this is only set in the MemberAPI class. I don't know whether this is as intended or whether you plan to give the PublicAPI optional _key and _secret fields.

My idea was to offer PublicAPI to every user, even if he doesn't have any credentials. So far I don't see any case where a digital library might want to use such PublicAPI with credentials, when a more powerful API is available at the same time.

bronger commented 8 years ago

I improved the PR. I hope that I left only little work for you to do.

MSusik commented 8 years ago

Thanks! Indeed, only small impromevents are needed.

Anyway, I noticed that the behaviour of the API has changed, so I have to fix the library before releasing a new version - one should simply not release broken code. Is this PR urgent or can it wait, let's say, two weeks?

bronger commented 8 years ago

There is no need for hurry. We are working with a local fork for the time being.