How to encode consumer key / consumer secret correctly?

This space is made available to users of Open Patent Services (OPS) web-service and now also to users of EPO’s bulk data subscription products such as 14. EPO worldwide bibliographic database (DOCDB), 14.11 EPO worldwide legal status database (INPADOC), 14.12 EP full text data, 14.1 EP bibliographic data (EBD)and more.

Users can ask each other questions, exchange experiences and solutions, post ideas. The moderator will use this space to announce changes or other relevant information.
Post Reply

jpatent
Posts: 19
Joined: Thu Aug 11, 2016 10:27 am

How to encode consumer key / consumer secret correctly?

Post by jpatent » Fri Nov 11, 2016 8:19 pm

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


EPO / OPS Support
Posts: 1298
Joined: Thu Feb 22, 2007 5:32 pm

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

Post by EPO / OPS Support » Mon Nov 14, 2016 9:14 am

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


jpatent
Posts: 19
Joined: Thu Aug 11, 2016 10:27 am

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

Post by jpatent » Mon Nov 14, 2016 8:16 pm

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


lectoip
Posts: 2
Joined: Fri Mar 02, 2018 4:09 pm

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

Post by lectoip » Sat Mar 03, 2018 4:15 pm

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...


Post Reply