Page 1 of 1

How to encode consumer key / consumer secret correctly?

Posted: Fri Nov 11, 2016 8:19 pm
by jpatent
Hey,
I have the code:

Code: Select all

$url = 'https://ops.epo.org/3.1/auth/accesstoken';

$request_headers = array();
$request_headers[] = 'Content-Type: application/x-www-form-urlencoded';
$request_headers[] = 'Authorization: Basic ...(key)...';

$postdata  = "grant_type=client_credentials";

$myCurl = curl_init($url);

curl_setopt($myCurl, CURLOPT_HTTPHEADER, $request_headers);
// Pass the post parameters as a naked string
curl_setopt($myCurl, CURLOPT_POSTFIELDS, $postdata);
// Bypass https
curl_setopt($myCurl, CURLOPT_SSL_VERIFYPEER, false);

// Option to Return the Result, rather than just true/false
curl_setopt($myCurl, CURLOPT_RETURNTRANSFER, true);
// Set the request type to POST
curl_setopt($myCurl, CURLOPT_POST, true);

$result = curl_exec($myCurl);
print_r($result);
curl_close($myCurl);
But i get the error: 401Client identifier is required
How do i encode my consumer key and my consumer secret correctly?

Thanks

Re: How to encode consumer key / consumer secret correctly?

Posted: Mon Nov 14, 2016 9:14 am
by EPO / OPS Support
Hi,

We hope some of the experienced user will be able to assist you with this. There were also several posts on how to handle credentials so you might search the forum again for older posts, but we hope some one reading this will offer you assistance.

Regards,
OPS support

Re: How to encode consumer key / consumer secret correctly?

Posted: Mon Nov 14, 2016 8:16 pm
by jpatent
Solved! :D

I found a website which encodes the consumer key and consumer secret just like in the example from OPS!

Example:
http://documents.epo.org/projects/babyl ... 3_1_en.pdf

The website:
http://www.motobit.com/util/base64-decoder-encoder.asp

I hope i can help some developers with this!

Jpatent

Re: How to encode consumer key / consumer secret correctly?

Posted: Sat Mar 03, 2018 4:15 pm
by lectoip
Sorry but your links and websites do not show.

Can someone demonstrate exactly how do I use the secret key to identify myself?

I am using VBA, if anyone else is...