How to assign custom message when refresh token expires,How to assign error message when refresh token expires

Not applicable

We are using expiry time for authentication code, access token and refresh token. For authentication code and access token we are generating proper expired message. For expired refresh token it just says:

{ "fault": { "faultstring": "invalid_request", "detail": { "errorcode": "invalid_request" } } }

How can we assign custom error message to expired refresh token scenario?

,

We are using expiry onauth code, accesstoken and refresh token. Both authentication code and access Token when they are expired, they generate proper error mentioning that the authentication code/accesstoken has expired. For the refresh token however when it expires, it only generates an error saying:

{ "fault": { "faultstring": "invalid_request", "detail": { "errorcode": "invalid_request" } } }

How can I assign a custom message to this so that it mentions that the refresh code is expired?

1 1 1,036
1 REPLY 1

Hi @apigeedevadmin

How are you validating the token for a refresh token flow ? Which policy are you using ?

My refresh token flow has the following Oauth policy

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OAuthV2 name="RefreshAccessToken">
    <Operation>RefreshAccessToken</Operation>
    <GrantType>request.queryparam.grant_type</GrantType>
    <GenerateResponse/>
</OAuthV2>

In my proxy, if I use a refresh token after 60 seconds, I get the following response

{"ErrorCode" : "invalid_request", "Error" :"Refresh Token expired"}