i'm testing authorization code grant protocol on instance of keyrock ge @ fiware-lab using dhc web client.
so far have succeeded on implementing authorization request, , obtain code used on access token request. url authorization request following (although not executed on dhc, on regular browser can introduce user , password):
https://account.lab.fiware.org/oauth2/authorize/?response_type=code&client_id=2122&redirect_uri=http%3a%2f%2flocalhost%2fcallback i have checked client_id , redirect_uri both correct against values related application @ account @ fiware-lab.
executing following request (can't post images, i'll describe)
post https:// account.lab.fiware.org/oauth2/token?grant_type=authorization_code&code=<code>&redirect_uri=http%3a%2f%2flocalhost%2fcallback -- <code> code obtained on auth. request authorization: basic <xxxx> --- <xxxx> result of base64(client_id+":"+client_secret) content-type: application/x-www-form-urlencoded ...i following error message:
{ "error":{ "message": "create_access_token() takes 3 arguments (2 given)", "code": 400, "title": "bad request" } } i've checked authorization correct (basic using oauth credentials application), , i'm using same redirect_uri used @ previous authorization request, , code obtained it.
¿what wrong?
p.s.: if remove or of query parameters, still same error
don't pass parameters in url. instead, add them request's body query string:
post /oauth2/token http/1.1 host: account.lab.fiware.org content-type: application/x-www-form-urlencoded authorization: basic <xxxx> --- <xxxx> cache-control: no-cache content-type: application/x-www-form-urlencoded grant_type=authorization_code&code=1234&redirect_uri=http%3a%2f%2flocalhost%3a9000%2fcodecallback.html
Comments
Post a Comment