# No Refresh or ID Tokens

**URL:** <https://community.auth0.com/t/no-refresh-or-id-tokens/80483>\
**Category:** Get Help\
**Tags:** refresh\_token, access-token, login, auth0\
**Created:** [March 24, 2022, 4:39pm UTC](https://community.auth0.com/t/no-refresh-or-id-tokens/80483 "2022-03-24T16:39:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![martincl](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/martincl/32/13714_2.png) [@martincl](https://community.auth0.com/u/martincl)\
**Post date:** [March 24, 2022, 4:39pm UTC](https://community.auth0.com/t/no-refresh-or-id-tokens/80483/1 "2022-03-24T16:39:23Z")

</div>

We are rather embarrassingly failing at step one of using Auth0 as an identity provider - getting our application to sign-in… Using the same OAuth client code against AWS Cognito provider and Auth0 gives a wildly different response - Cognito returns access, refresh and ID tokens whereas Auth0 only returns a rather short access token which doesn’t work when using it to hit our API (via AWS API Gateway).

I’m not too worried about the access token not working through API Gateway because I think we have bigger issues with a missing refresh and ID tokens.

This seems so basic so must be a misconfigured setting that we’ve done - I’m hoping someone can just say duh, you just need to do xyz. Any ideas?

---

<div class="post-metadata">

**Author:** ![markd](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/markd/32/38919_2.png) [@markd](https://community.auth0.com/u/markd)\
**Post date:** [March 25, 2022, 2:10am UTC](https://community.auth0.com/t/no-refresh-or-id-tokens/80483/2 "2022-03-25T02:10:53Z")

</div>

The “short” access token sounds like it might be an [opaque token](https://auth0.com/docs/secure/tokens/access-tokens#opaque-access-tokens), which is what you will get back from Auth0 if you do not specify an [`audience`](https://auth0.com/docs/secure/tokens/access-tokens/get-access-tokens#control-access-token-audience) string in your request.

ID and refresh tokens are returned only if you request the associated scopes, `openid` and `offline_access` respectively.

> **[OpenID Connect Scopes](https://auth0.com/docs/get-started/apis/scopes/openid-connect-scopes)**
>
> Understand scopes and claims used with the OpenID Connect (OIDC) protocol.

> **[Get Refresh Tokens](https://auth0.com/docs/secure/tokens/refresh-tokens/get-refresh-tokens)**
>
> Describes how to get a Refresh Token when you initiate a request using the Authorize endpoint.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [March 25, 2022, 7:21am UTC](https://community.auth0.com/t/no-refresh-or-id-tokens/80483/3 "2022-03-25T07:21:05Z")

</div>

Thanks for helping on this thread Mark!

---

<div class="post-metadata">

**Author:** ![martincl](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/martincl/32/13714_2.png) [@martincl](https://community.auth0.com/u/martincl)\
**Post date:** [March 25, 2022, 8:47am UTC](https://community.auth0.com/t/no-refresh-or-id-tokens/80483/4 "2022-03-25T08:47:10Z")

</div>

Sorry to be dumb, is audience an Auth0 thing? We’re struggling to find many references to audience anywhere outside of Auth0 so getting a standard oauth client working is proving somewhat challenging! I thought that Auth0 was supposed to be a drop in replacement for other oauth providers.

This Auth0 PHP quickstart for example, doesn’t even mention audience:

> **[Auth0 PHP SDK Quickstarts: Login](https://auth0.com/docs/quickstart/webapp/php/01-login)**
>
> This guide demonstrates how to integrate Auth0 with a PHP application using the Auth0 PHP SDK.

---

<div class="post-metadata">

**Author:** ![markd](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/markd/32/38919_2.png) [@markd](https://community.auth0.com/u/markd)\
**Post date:** [March 25, 2022, 10:24pm UTC](https://community.auth0.com/t/no-refresh-or-id-tokens/80483/5 "2022-03-25T22:24:53Z")

</div>

Use of an audience is recommended by the OAuth specs and best practices, and I believe it is mandatory for OpenID Connect.

ref:

- [RFC 6750: The OAuth 2.0 Authorization Framework: Bearer Token Usage](https://www.rfc-editor.org/rfc/rfc6750)
- [RFC 6819 - OAuth 2.0 Threat Model and Security Considerations](https://datatracker.ietf.org/doc/html/rfc6819)
- [Final: OpenID Connect Core 1.0 incorporating errata set 1](https://openid.net/specs/openid-connect-core-1_0.html)

I don’t really know PHP but there are references to an audience field in the source code for that quickstart:

> **[Search · audience · auth0-samples/auth0-php-web-app](https://github.com/auth0-samples/auth0-php-web-app/search?q=audience)**
>
> Auth0 Integration Samples for PHP Web Applications - Search · audience · auth0-samples/auth0-php-web-app

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [March 31, 2022, 10:48am UTC](https://community.auth0.com/t/no-refresh-or-id-tokens/80483/6 "2022-03-31T10:48:22Z")

</div>


