Extend Auth Token For Restful Services Using "curl" Command Fails With Error: {"error":"invalid_grant"}

(Doc ID 1916551.1)

Last updated on MARCH 08, 2017

Applies to:

Oracle REST Data Services - Version 2.0.7 and later
Information in this document applies to any platform.


On : 2.0.7 & 2.0.8 versions.

Extend Auth Token For Restful Services Using "curl" Command  Fails With Error: {"error":"invalid_grant"}

While trying to extend the OAUTH token using refresh_token and curl, it fails with the error {"error":"invalid_grant"}.

The following document is followed to implement this:
ORDS developer guide

The Auth code is exchanged for a token but an error occurs when trying
to extend the token with the refresh token.

Details of Issue below. This issue also happens in local ORDS
environment for the customer.

Registered Client and Approved Request, Received Auth Code

Swapped Code for Token
curl -i -d "grant_type=authorization_code&code=mkqNl8wEySuqstZDehW-9g.."
--user bWjUoDP5iLJVW1pz3pj8yg..:nW7FJrU_RQubf4AkyVF9-A..

HTTP/1.1 200 OK
Date: Tue, 05 Aug 2014 01:07:45 GMT
Server: Oracle-Application-Server-11g

httponly; secure; path=/
X-Powered-By: Servlet/2.5 JSP/2.1
Vary: Accept-Encoding
Transfer-Encoding: chunked
Content-Type: application/json
Content-Language: en


Attempt to Extend Token

curl -i -d
"grant_type=refresh_token&refresh_token=O4JKUstAJTGaTvX2FfYeJQ.." --user



Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms