Skip to content

'Refresh token expired' exception with Keycloak SSO #416

@claudiat

Description

@claudiat

Hello,

I have implemented the AppAuth library with the Keycloak SSO and I get refresh tokens that expire within 30 minutes after the token request. Therefore, when I try to get a new access token by calling the 'performActionWithFreshTokens' function 30 minutes after calling the 'performTokenRequest' function, I get the following exception :
{"type":2,"code":2002,"error":"invalid_grant","errorDescription":"Refresh token expired","errorUri":""}

I tried to dodge this problem by getting an offline token by specifying 'offline_access' in setScope in the AuthorizationRequest builder but I get the following exception:
AuthorizationException: {"type":0,"code":5,"errorDescription":"JSON deserialization error"}

The "offline_access" is however supported in the SSO configuration.

My questions are :

  • do you happen to kwno why do my refresh tokens have a validity time of only 30 minutes?
  • why do I get the "JSON deserialization" error even if my Keycloak configuration allows for offline tokens?

Thank you for your time!

Metadata

Metadata

Assignees

No one assigned

    Labels

    provider-behaviorIssues that relate to the behavioral quirks of a specific IDP / OAuth2 implementation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions