Generate a two step (read-public) access token:"error":"invalid_client","error_description":"Client

608 views
Skip to first unread message

Alper Alimoglu

unread,
May 7, 2018, 10:04:39 AM5/7/18
to ORCID API Users
I am following up this thread. I have followed (https://github.com/ORCID/ORCID-Source/tree/master/orcid-api-web#generate-a-two-step-read-public-access-token)

I have tried with my `Client ID` and` Client secret`

curl -i -L -H 'Accept: application/json' -d 'client_id=APP-674MCQQR985VZZQ2' -d 'client_secret=d08b711e-9411-788d-a474-46efd3956652' -d 'scope=/read-public' -d 'grant_type=client_credentials' 'https://sandbox.orcid.org/oauth/token'

But I am getting this error, is this normal?

{"error":"invalid_client","error_description":"Client not found: APP-90R3NMFJNN5M4J84"}%
Message has been deleted

Alper Alimoglu

unread,
May 7, 2018, 10:08:22 AM5/7/18
to ORCID API Users

Alainna Wrigley

unread,
May 7, 2018, 10:11:29 AM5/7/18
to Alper Alimoglu, ORCID API Users
Hello, 

Thanks for your message. 

It seems that there is an issue with the client secret. Please try: 

curl -i -L -H 'Accept: application/json' -d 'client_id=APP-674MCQQR985VZZQ2' -d 'client_secret=d08b711e-9411-488d-a474-46efd3958842' -d 'scope=/read-public' -d 'grant_type=client_credentials' 'https://sandbox.orcid.org/oauth/token'

Warm regards, 
Alainna 

On 7 May 2018 at 09:07, Alper Alimoglu <alper.a...@gmail.com> wrote:

--
You received this message because you are subscribed to the Google Groups "ORCID API Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orcid-api-users+unsubscribe@googlegroups.com.
To post to this group, send email to orcid-api-users@googlegroups.com.
Visit this group at https://groups.google.com/group/orcid-api-users.
For more options, visit https://groups.google.com/d/optout.



--

Alper Alimoglu

unread,
May 7, 2018, 10:18:08 AM5/7/18
to ORCID API Users
=> Could I try that public client_id and client_secret?

Mine is actually as follow: Which still returns the same error: 
client_id: APP-90R3NMFJNN5M4J84 
client secret: df27394b-6301-47a8-bc65-0a258355134d

But the curl code you sent, it works on my end.


On Monday, May 7, 2018 at 5:11:29 PM UTC+3, Alainna wrote:
Hello, 

Thanks for your message. 

It seems that there is an issue with the client secret. Please try: 

curl -i -L -H 'Accept: application/json' -d 'client_id=APP-674MCQQR985VZZQ2' -d 'client_secret=d08b711e-9411-488d-a474-46efd3958842' -d 'scope=/read-public' -d 'grant_type=client_credentials' 'https://sandbox.orcid.org/oauth/token'

Warm regards, 
Alainna 
On 7 May 2018 at 09:07, Alper Alimoglu <alper.a...@gmail.com> wrote:
Followed thread: https://github.com/ORCID/ORCID-Source/issues/4565#event-1611643309


On Monday, May 7, 2018 at 5:04:39 PM UTC+3, Alper Alimoglu wrote:
I am following up this thread. I have followed (https://github.com/ORCID/ORCID-Source/tree/master/orcid-api-web#generate-a-two-step-read-public-access-token)

I have tried with my `Client ID` and` Client secret`

curl -i -L -H 'Accept: application/json' -d 'client_id=APP-674MCQQR985VZZQ2' -d 'client_secret=d08b711e-9411-788d-a474-46efd3956652' -d 'scope=/read-public' -d 'grant_type=client_credentials' 'https://sandbox.orcid.org/oauth/token'

But I am getting this error, is this normal?

{"error":"invalid_client","error_description":"Client not found: APP-90R3NMFJNN5M4J84"}%

--
You received this message because you are subscribed to the Google Groups "ORCID API Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orcid-api-use...@googlegroups.com.
To post to this group, send email to orcid-a...@googlegroups.com.

Alainna Wrigley

unread,
May 7, 2018, 10:21:08 AM5/7/18
to Alper Alimoglu, ORCID API Users
As Catalina notes, this is because the client is for the production server, but the token URL is for sandbox. Try: 

curl -i -L -H 'Accept: application/json' -d 'client_id=APP-90R3NMFJNN5M4J84' -d 'client_secret=df27394b-6301-47a8-bc65-0a258355134d' -d 'scope=/read-public' -d 'grant_type=client_credentials' 'https://orcid.org/oauth/token'

best, 
Alainna


To unsubscribe from this group and stop receiving emails from it, send an email to orcid-api-users+unsubscribe@googlegroups.com.
To post to this group, send email to orcid-api-users@googlegroups.com.

Alper Alimoglu

unread,
May 7, 2018, 10:27:09 AM5/7/18
to ORCID API Users
I am sorry for too much questions...

With the generated token I have tried this to pull the record:
curl -i -H "Accept: application/vnd.orcid+xml" -H 'Authorization: Bearer 211ea945-d197-4f88-b0f7-c6cb7f0c89f4' 'https://api.sandbox.orcid.org/v2.1/0000-0002-9227-8514/record'

With the token generated from my client id and client secret it gives this error: 
{"error":"invalid_token","error_description":"Invalid access token: 211ea945-d197-4f88-b0f7-c6cb7f0c89f4"}%

 But I have successfully the retrieve the record from the token generated from this: (client_id and client_secret is actually given on the documentation)
curl -i -L -H 'Accept: application/json' -d 'client_id=APP-674MCQQR985VZZQ2' -d 'client_secret=d08b711e-9411-488d-a474-46efd3958842' -d 'scope=/read-public' -d 'grant_type=client_credentials' 'https://sandbox.orcid.org/oauth/token'

What might be the reason for this? 

Alper Alimoglu

unread,
May 7, 2018, 10:44:48 AM5/7/18
to ORCID API Users
I have change https:/sandbox.orcid/ with https://orcid.org/. Now it returns something but I do not see record's xml output.

$ curl -i -H "Accept: application/vnd.orcid+xml" -H 'Authorization: Bearer 824111fa-0c68-4d10-a85b-0beab7d51515' 'https://orcid.org/v2.1/0000-0001-7642-0552/record'
HTTP/1.1 302 Found
Date: Mon, 07 May 2018 14:43:02 GMT
Content-Length: 0
Connection: keep-alive
Set-Cookie: __cfduid=d55ff151d2c1e6e3afaeb92f89ace40721525704182; expires=Tue, 07-May-19 14:43:02 GMT; path=/; domain=.orcid.org; HttpOnly
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Location: https://orcid.org/signin
Expires: 0
Pragma: no-cache
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Set-Cookie: X-Mapping-fjhppofk=5491AB00FA9E4A85A0FB69A74B2E5B7F; path=/
Set-Cookie: JSESSIONID=33082A407C14BBA12018854F7FC604C9; Path=/; Secure; HttpOnly
X-Frame-Options: SAMEORIGIN
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Server: cloudflare
CF-RAY: 417474e29843ad3e-OTP


Wilmers, Catalina

unread,
May 7, 2018, 11:14:22 AM5/7/18
to Alper Alimoglu, ORCID API Users
Hi,

In your call you are using the url orcid.org which is calling the ORCID website not the API, which is why you are getting the 302 message. As you're trying to call the public API, you need to chance the URL to https://pub.orcid.org, as in the examples at https://github.com/ORCID/ORCID-Source/blob/master/orcid-api-web/tutorial/read_public.md. Your call would then look like:

curl -i -H "Accept: application/vnd.orcid+xml" -H 'Authorization: Bearer 824111fa-0c68-4d10-a85b-0beab7d51515' 'https://pub.orcid.org/v2.1/0000-0001-7642-0552/record'

Also, I noticed in a previous message you included the secret to your credentials for the public API. The client secret should not be publicly shared as it will allow others to user your credentials. Please reset your client secret, which you can do from the Developers Tools page (https://orcid.org/developer-tools) to ensure your credentials are not compromised.

Thanks,
-Catalina

Alper Alimoglu

unread,
May 7, 2018, 12:43:31 PM5/7/18
to ORCID API Users
Thanks for your help, it works!! 

note: I reset my client_secret.
Reply all
Reply to author
Forward
0 new messages