GetOAuthV2Info for refresh token not getting custom attributes

I have a custom flow for OAuth2 where I want to make use of the refreshToken to generate accessToken's till the refreshToken expires. This is not a standard OAuth2 flow. In OAuth2 the refreshToken is one time use and RefreshToken policy returns new refreshToken and accessToken. But in this custom flow I need to reuse the refreshToken till it expires.

The caller calls this endpoint with OAuth2 refreshToken and I am trying to get token information by calling GetOAuthV2Info. As per GetOAuthV2Info docs following refresh token variables should be populated -

oauthv2refreshtoken.{policy_name}.access_token
oauthv2refreshtoken.{policy_name}.refresh_token
oauthv2refreshtoken.{policy_name}.client_id
oauthv2refreshtoken.{policy_name}.refresh_count
oauthv2refreshtoken.{policy_name}.organization_name
oauthv2refreshtoken.{policy_name}.refresh_token_expires_in
oauthv2refreshtoken.{policy_name}.refresh_token_issued_at
oauthv2refreshtoken.{policy_name}.refresh_token_status
oauthv2refreshtoken.{policy_name}.developer.email
oauthv2refreshtoken.{policy_name}.developer.id
oauthv2refreshtoken.{policy_name}.developer.app.name
oauthv2refreshtoken.{policy_name}.developer.app.id
oauthv2refreshtoken.{policy_name}.{custom_attribute_name}

But I am not getting the values of the custom attributes. In trace tool I see oauthv2refreshtoken.Get-OAuth-v20-Info-Refresh-Token.refresh_token_expires_in has value, oauthv2refreshtoken.Get-OAuth-v20-Info-Refresh-Token.client_id also has value. But I am not seeing values for the custom attributes. The Get-OAuth-v20-Info-Refresh-Token policy is

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<GetOAuthV2Info async="false" continueOnError="false" enabled="true" name="Get-OAuth-v20-Info-Refresh-Token">
    <DisplayName>Get OAuth v2.0 Info Refresh Token</DisplayName>
    <RefreshToken ref="refreshCallout.refreshToken"></RefreshToken>
</GetOAuthV2Info>

The variable refreshCallout.refreshToken has refreshToken. Is there any other step I need to do in order to populate oauthv2refreshtoken.Get-OAuth-v20-Info-Refresh-Token.custom_attribute_name?

I am using Apigee Edge on-premise version 4.15.04.00

2 2 471
2 REPLIES 2

Has anyone come across this issue?

From previous post What is best way to search for refresh tokens by custom user attribute? custom attributes are set on AccessToken. What happens to RefreshToken if AccessToken expires? Is there a way to set custom attributes on refreshToken when accessToken has expired? Also SetOAuthV2Info policy takes AccessToken and not RefreshToken.