Legacy Dev Forum Posts

 View Only

Sign Up

Extract the refresh token from the Auth response using Java SDK

  • 1.  Extract the refresh token from the Auth response using Java SDK

    Posted 06-05-2025 18:17

    Luigi | 2020-06-16 09:23:18 UTC | #1

    Hi.

    Almost 3 months ago, refresh tokens have been introduced in Genesys Cloud to request a new access token after the old one expires. As a matter of fact, the OAuth response is now structured as following (in bold the JSON entry introduced by such update):

    { "accesstoken":"token1", "tokentype":"bearer", "expiresin":86399, **"refreshtoken":"token2"** }

    Since I use a code authorization client in an application, I tried to extract the refresh token using your latest available SDK (i.e., 93.0.0). In my attempts, I discovered that your com.mypurecloud.sdk.v2.extensions.AuthResponse object does not have a property that maps the refresh_token field, and actually the information is lost. For the time being, I developed a workaround in which the refresh token is extracted from the bare JSON response.

    Will you include the refresh token support in future versions of the SDK?

    Thanks in advance.

    Luigi


    anon11147534 | 2020-06-16 13:03:32 UTC | #2

    Luigi,

    We're planning on adding refresh tokens to the SDKs in an upcoming release. Keep an eye on the releases for the addition.

    Ronan


    system | 2020-07-17 13:03:32 UTC | #3

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 8028