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

error="invalid_token", error_description="Invalid access token: '...' #4565

Closed
avatar-lavventura opened this issue May 5, 2018 · 7 comments

Comments

@avatar-lavventura
Copy link

avatar-lavventura commented May 5, 2018

I have followed this guide's Retrieving Public Data section:

Please note that I have successfully obtained my token and paste it next to Bearer :
Example output of my access_token:

{"access_token":"baf58c02-e7ca-45b2-950a-44d6a39f851e","token_type":"bearer","refresh_token":"0b5bcdec-ff67-42b2-9c27-906126b2f66b","expires_in":631138518,"scope":"/authenticate","name":"name surname","orcid":"0000-0001-7642-0552"}%


I keep getting following error ({"error":"invalid_token","error_description":"Invalid access token: dd91868d-d29a-475e-9acb-bd3fdf2f43f4"}) when I try to obtain the public record:

$ token='baf58c02-e7ca-45b2-950a-44d6a39f851e';
$ curl -i -H "Accept: application/vnd.orcid+xml" -H 'Authorization: Bearer dd91868d-d29a-475e-9acb-bd3fdf2f43f4' 'https://api.sandbox.orcid.org/v2.1/0000-0002-9227-8514/record'

HTTP/1.1 401 Unauthorized
Server: nginx/1.10.0
Date: Sat, 05 May 2018 18:18:04 GMT
Content-Type: application/vnd.orcid+xml;charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Access-Control-Allow-Origin: *
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-XSS-Protection: 1; mode=block
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
Cache-Control: no-store
Pragma: no-cache
WWW-Authenticate: Bearer realm="ORCID T2 API", error="invalid_token", error_description="Invalid access token: dd91868d-d29a-475e-9acb-bd3fdf2f43f4"

{"error":"invalid_token","error_description":"Invalid access token: dd91868d-d29a-475e-9acb-bd3fdf2f43f4"}%

[Q] What should I do to overcome this error? What might be the reason for this?

@alainna
Copy link
Contributor

alainna commented May 6, 2018

@avatar-lavventura We have a mailing list for API issues. Please see: https://groups.google.com/group/orcid-api-users

@alainna alainna closed this as completed May 6, 2018
@avatar-lavventura
Copy link
Author

Thanks @alainna .

@rcpeters
Copy link
Contributor

rcpeters commented May 6, 2018

The actual issue the /authenticate token can't be used for anything. When you get the token you also get the ORCID iD in the token returned, which is the authenticate aspect. For public api users there is also a two step /read-public token.

@rcpeters
Copy link
Contributor

rcpeters commented May 6, 2018

@avatar-lavventura
Copy link
Author

avatar-lavventura commented May 7, 2018

Sorry I get lost on the documentation section. I just want to GET record of a user, please note that I do have only a personal account.

I am using this section with the access_token that obtained from Developer Tools (https://orcid.org/developer-tools) section.

screen shot 2018-05-07 at 10 46 35

[Q] How can I obtain /read-public token? Isn't it same as access_token?

I would appreciate if you could guide me in this. @rcpeters

@lizkrznarich
Copy link
Contributor

@avatar-lavventura /read-public tokens are generated using client credentials grant type (rather than authorization code) - see https://github.com/ORCID/ORCID-Source/tree/master/orcid-api-web#generate-a-two-step-read-public-access-token In the future, please post questions to the API users group https://groups.google.com/group/orcid-api-users

@avatar-lavventura
Copy link
Author

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

4 participants