You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 12, 2024. It is now read-only.
orcid_auth() wouldn't work in this scenario, as I didn't want the students to have to download R and you can't open a browser window from within the Jupyter Notebook for the 3 legged authentication. ORCID provides a way to get the key via 2-legged OAuth: https://members.orcid.org/api/oauth/2legged-oauth. From my understanding, in order to do this the user has to have a client secret and key. Once they have it, I wrote the following request to get their access token (fake client ID and secret). Just something to consider for future iterations. Thanks for all your work on rorcid and with ROpenSci, as always I find your work to be immensely helpful and indispensable.
# copy/paste your client ID from https://orcid.org/developer-toolsorcid_client_id<-"APP-UXL71DIF91UFKDA"# copy/paste your client secret from https://orcid.org/developer-toolsorcid_client_secret<-"c7e221dc-0b9c-48cf-92sq-24446b8490231e"# send the request for the access tokenorcid_request<- POST(url="https://orcid.org/oauth/token",
config= add_headers(`Accept`="application/json",
`Content-Type`="application/x-www-form-urlencoded"),
body=list(grant_type="client_credentials",
scope="/read-public",
client_id=orcid_client_id,
client_secret=orcid_client_secret),
encode="form")
# parse tokenorcid_response<- content(orcid_request)
# set token
Sys.setenv(ORCID_TOKEN=orcid_response$access_token)
#confirm authorizationrorcid::orcid_auth(scope="/authenticate",
reauth=TRUE)
add client_id and client_secret params to orcid_auth
if client_id and client_secret not NULL, collect token using them (assuming previous steps passed)
change docs for orcid_auth describing the now 3 options for auth
bump version
I agree it's not always possible to open a browser. I think what I've written in the docs, or just thought in my head maybe, was that users can get the token via 3 legged auth and then store the key as an env var locally, but this is a good idea to allow a workflow that doesn't require an interactive step so that it works on servers and other environments that don't allow opening a auth window.
used a modified version of code above, and its used inside orcid_auth, reinstall , then see new params client_id and client_secret - also updated the description of the different auth options in the orcid_auth manual file - let me know if you have any thoughts
Hi Scott, I recently created a Jupyter Notebook in a Binder environment to teach rorcid. See https://ciakovx.github.io/rorcid for the walkthrough, and https://mybinder.org/v2/gh/ciakovx/ciakovx.github.io/ab4cd2280f36aad96fbcd6fd72c932c0323f1be8 for the direct link to the Binder.
orcid_auth()
wouldn't work in this scenario, as I didn't want the students to have to download R and you can't open a browser window from within the Jupyter Notebook for the 3 legged authentication. ORCID provides a way to get the key via 2-legged OAuth: https://members.orcid.org/api/oauth/2legged-oauth. From my understanding, in order to do this the user has to have a client secret and key. Once they have it, I wrote the following request to get their access token (fake client ID and secret). Just something to consider for future iterations. Thanks for all your work on rorcid and with ROpenSci, as always I find your work to be immensely helpful and indispensable.Session Info
The text was updated successfully, but these errors were encountered: