OAuth refresh token grant type and OAuth access and refresh token expiration | The place for Zendesk users to come together and share
Skip to main content
Shawna James
Community Manager
Apr 30, 2025 4:13 PM UTC
Accepted

OAuth refresh token grant type and OAuth access and refresh token expiration

Related products:Admin center

Dear Community, 

 

We have recently released support for the OAuth refresh token grant type  for more robust and flexible API authentication. We are thrilled to have you start trying this feature and hear your thoughts.

 

Please share your feedback with us here in the comments below to help us improve this feature! We will be moderating this thread to respond when needed. We appreciate you taking the time to share your insights. 

    28 replies

    May 26, 2025 11:13 AM UTC

    Hi! 

     

    I'm trying to migrate to the refresh_token flow, but I'm having an issue with this.

     

    Every time I try to refresh the token it fails with the error:

     

    {"error":"invalid_grant","error_description":"The provided access grant is invalid, expired, or revoked (e.g. invalid assertion, expired authorization token, bad end-user password credentials, or mismatching authorization code and redirection URI)."}
     

    My code looks the same as the “Example Node.js refresh token grant flow” code here: https://developer.zendesk.com/api-reference/ticketing/oauth/grant_type_tokens/, and I'm validating the data I'm sending that all the values are actually being filled in correctly.

     

    I've also tried including the “redirect_uri” as a parameter even though it isn't listed in the example, but it's still not working.

     

    Not sure how else I can debug this? The details I'm testing with are:

     

    https://{ZENDESK_SUBDOMAIN}.zendesk.com/oauth/tokens

    {
       "grant_type": "refresh_token",
       "refresh_token": "{ACTUAL_REFRESH_TOKEN}",
       "client_id": "{ACTUAL_CLIENT_ID}",
       "client_secret": "{ACTUAL_CLIENT_SECRET}",
       "scope": "read write tickets:read tickets:write",
       "expires_in": 300,
       "refresh_token_expires_in": 2592000
    }
     

    Thanks!

    Translate
    Jos11
    Jun 2, 2025 7:02 AM UTC

    This appears broken. It always returns this error:
     

    {
        "error": "invalid_grant",
        "error_description": "The provided access grant is invalid, expired, or revoked (e.g. invalid assertion, expired authorization token, bad end-user password credentials, or mismatching authorization code and redirection URI)."
    }
    Translate
    Caroline Kello
    Product Manager
    Jun 2, 2025 10:20 PM UTC

    Thanks to both of you as you helped us identify a bug that we're addressing right now. I'll be back to update this thread once we have a fix out. 

    Translate
    Caroline Kello
    Product Manager
    Jun 3, 2025 7:49 PM UTC

    Fix is released! @jos11 and @phil42 if you could please test and confirm 🙏

    Translate
    Jos11
    Jun 4, 2025 2:56 AM UTC

    Thank you Caroline, it appears to work now.

    Translate
    Jun 4, 2025 7:46 PM UTC

    Same here Caroline, looks like we're all good now! Thanks for getting fixed so quickly!

    Translate
    Jun 6, 2025 10:32 AM UTC

    Hello Shawna/Caroline,

     

    As for new authorisation requests, the new refresh_token flow needs to be implemented and needs to be used for further usage.

    But for existing tokens that are authorised before this release, what should we need to do for these tokens?
    Does the tokens work without any issues, since there is no expiry for the tokens? Or Do we need to reauthorise those accounts and generate a new pair of tokens and use those?

    Translate
    Jun 6, 2025 10:36 AM UTC

    Hello Shawna/Caroline,

     

    As mentioned in the post the new authorisation requests must comply with the new refresh_token flow.

    But what will happen for the tokens that are authorised before this? Will it work without any issues (or) do we need to reauthorise those accounts with the new flow and use the new token for the API requests?

    Translate
    Caroline Kello
    Product Manager
    Jun 9, 2025 10:42 PM UTC

    We will be giving all tokens an expiration if they don't currently have one, which is why you have this period to adopt the refresh token flow to make sure you're prepare to handle it gracefully. When the access token expires, you'll be able to use the refresh token to get a new access token without having to ask the user to sign in again. If the refresh token expires then the user will be prompted to sign in again in order to issue a new access token.

    Translate
    Jos11
    Jun 10, 2025 6:24 AM UTC

    Hi Caroline,

    People who authenticated before this change was made never received refresh tokens. Do you currently have a date on when the old auth tokens will be changed to expired? Then I'll make sure we let everyone reauthenticate before that time.

    Thank you

    Translate