OVH Community, your new community space.

Get the Access Token

07-04-2014, 02:28 PM

In the HTTP Header 'Authorization: Basic', you need to provide your credentials.

In this case, we are waiting a base64 encoded of your credentials, separated by ':'.

If your application key = "toto" and your application secret is "tata", then your Basic authentication is base64("toto:tata").

The final HTTP header looks like that : 'Authorization' : 'Basic dG90bzp0YXRh'

07-02-2014, 10:14 PM
Hi everyone,

I have a little problem to get an access token in python.

Here is my test :

    s = requests.session()

    print "***********"

    code = raw_input("Please enter the code : ")
    print code

    headers = {'content-type': 'application/x-www-form-urlencoded', 'Authorization': 'Basic'}
    params = {'code':code, 'redirect_uri':redirect_uri, 'grant_type':'authorization_code'}
    r =" HTTP/1.1", params=params, headers=headers)
    print r.text
The Authorization code is ok, but for the second part, I always get this json:

{"error_description":"missing arguments","error":"invalid_request"}
I use the requests lib, do you have an idea ?

Thank you in advance for your help,