Hi all,
Did anyone have any success generating the access token using the wget command:
wget --no-check-certificate --header='Authorization: Basic <base64_string>' --header='Content-Type: application/x-www-form-urlencoded' <https_access_token_url>
and
wget --no-check-certificate --header='Authorization: Basic <base64_string>' --header='Content-Type: application/x-www-form-urlencoded' <https_access_token_url?grant_type=client_credentials>
I keep on getting a 400 error.
I also read one of the posts and tried the httprequester add-on for firefox and get the following error:
POST <https_access_token_url?grant_type=client_credentials>
Authorization: Basic <base64_string>
Content-Type: text/xml
-- response --
400 Bad Request
Content-Type: application/xml
WWW-Authenticate: Basic
Content-Length: 91
Connection: keep-alive
<error><code>400</code><message>Required param : grant_type</message>
</error>
Has anyone had any success generating the access token? If you did, which method did you use?
Thanks for any replies!
Access tokens
-
- Posts: 1298
- Joined: Thu Feb 22, 2007 5:32 pm
Re: Access tokens
To get the access token we need to send a POST request with "grant_type=client_credentials" in its body and the "Content-Type" header set to "application/x-www-form-urlencoded". I have tried the following command and it works:
curl -H "Authorization: Basic QWYzMjBrUVdkb1VnUmxnNUNrN3NITU5PVFN2cHI0M0Y6NWtuanh1YldoblhkeG45eQ==" -H "Content-Type: application/x-www-form-urlencoded" -d "grant_type=client_credentials" -X POST https://ops.epo.org/3.1/auth/accesstoken
Kind regards,
OPS support
curl -H "Authorization: Basic QWYzMjBrUVdkb1VnUmxnNUNrN3NITU5PVFN2cHI0M0Y6NWtuanh1YldoblhkeG45eQ==" -H "Content-Type: application/x-www-form-urlencoded" -d "grant_type=client_credentials" -X POST https://ops.epo.org/3.1/auth/accesstoken
Kind regards,
OPS support
Re: Access tokens
Thanks for the reply! I got it to work for the wget command. I made a big mistake by adding "grant_type=client_credentials" to the url instead of the body.
Have a nice day!
Have a nice day!