cancel
Showing results for 
Search instead for 
Did you mean: 

Refreshing the Access Token

Hello Team,
 
I am following this documentation :
to complete the flow of obtaining the access_token.
 
When I am making a POST http request to https://access.authorize.net/oauth/v1/token. I am getting the following response:
{
    "access_token": "eyJraW.....OTeuSng8vb0Ig",
    "token_type": "bearer",
    "expires_in": 28799,
    "scope": "read write",
    "client_status": "active"
}
 
which is not as per the documentation.
The response as per doc is:
{
  "access_token": "eyJra.....YoqAQtnQ",
  "token_type": "bearer",
  "refresh_token": "eyJra...syKv8w",
  "expires_in": 28798,
  "scope": "read write",
  "refresh_token_expires_in": 28799,
  "client_status": "active"
}
 
So I am missing the refresh_token parameter in response, because of which I am not able to refresh the access_token when it expires.
 
Is there any other means to refresh the access_token?
Can you please guide what has to be done in this scenario?
 
orderhive
Member
1 ACCEPTED SOLUTION

Accepted Solutions

Thanks @orderhive for the information . 

 

This looks to be a bug in the Partner UI where its not providing the correct grant type to the client . 

 

The team is working on the fix and will be release soon . 

 

As a workaround  we have updated your clientID M4sPtfxKpk with the correct grant Type . 

 

Let us know if this solves the issue . 

 

Thanks

Anurag





Send feedback at developer_feedback@authorize.net

View solution in original post

5 REPLIES 5

Hi @orderhive

 

Are you passing the grant_type=refresh_token in the url ?

 

POST https://access.authorize.net/oauth/v1/token
Content-Type: application/x-www-form-urlencoded

client_id=8l57hYffFb&client_secret=67868687&grant_type=refresh_token&refresh_token=eyJraWQiOiI4MGI2ZDJjM2NkZGRkMmY2NmY3MmRjYjIyMmZiNGM1MCIsImFsZyI6IlJTMjU2In0.eyJqdGkiOiI0N2

 

Also are you trying on sandbox or prod env ?





Send feedback at developer_feedback@authorize.net
Anurag
Moderator Moderator
Moderator

I am using the production env.

I am making call to retrieve access_token and at that time I am passing grant_type=authorization_code in request.

I am attaching the Request and Response of API call which I am making in Postman

Request:

POST https://access.authorize.net/oauth/v1/token

Body: Content-Type:application/x-www-form-urlencoded

 

[{"key":"grant_type","value":"authorization_code"},

{"key":"code","value":"4rkKLY"},

{"key":"client_id","value":"M4sPtfxKpk"},

{"key":"client_secret","value":"........."},

{"key":"platform","value":"2"}]

 

 

Response:

{
"access_token": "eyJra.....8vb0Ig",
"token_type": "bearer",
"expires_in": 28799,
"scope": "read write",
"client_status": "active"
}

Thanks @orderhive for the information . 

 

This looks to be a bug in the Partner UI where its not providing the correct grant type to the client . 

 

The team is working on the fix and will be release soon . 

 

As a workaround  we have updated your clientID M4sPtfxKpk with the correct grant Type . 

 

Let us know if this solves the issue . 

 

Thanks

Anurag





Send feedback at developer_feedback@authorize.net

Thanks for the workaround.

 

It is now providing proper response for clientId: M4sPtfxKpk