<@U04UQ68083H> I cannot receive the refresh token ...
# ory-copilot
n
@chilly-king-10285 I cannot receive the refresh token in the response to the /token endpoint even though I have allowed offline_access scope in the oauth client. Any clues as to what more is required?
c
A message from kapa.ai
To receive a refresh token, you need to ensure a few things: 1. The
offline_access
scope must be requested during the initial token issuance. This scope indicates that the client needs a refresh token. [source](https://www.ory.sh/docs/oauth2-oidc/refresh-token-grant) 2. Not all OAuth2 and OIDC flows support refresh tokens. For instance, the Authorization Code flow supports refresh tokens, but the Implicit flow and Client Credentials flow do not. Make sure you're using a flow that supports refresh tokens. [source](https://www.ory.sh/docs/oauth2-oidc/refresh-token-grant) 3. If you're using a custom UI for the consent screen, you need to include the
offline_access
scope in the list of
grant_scope
for a refresh token to be returned. [source](https://www.ory.sh/docs/oauth2-oidc/refresh-token-grant) 4. The client needs to be allowed to request the
offline_access
scope and the user has to accept that the client may use the
offline_access
scope on the consent screen. [source](https://www.ory.sh/docs/oauth2-oidc/authorization-code-flow) 5. Ensure that your OAuth 2.0 Client is correctly configured. You can check the client's configuration using the command
ory get oauth2-client {client.id}
. [source](https://www.ory.sh/docs/hydra/debug) If you've checked all these points and are still having issues, there might be a problem with your implementation. You might want to check your code against the examples provided in the Ory documentation.