with-auth0 example with API access and refresh tokens
- Dominant language
- TypeScript
- Stars
- 3.7k
- Forks
- 1.1k
- Avg merge
- 11h 15m
- Merged PRs (30d)
- 1
Description
**Refresh tokens and API access**
It would be really helpful to have a reference implementation that deomostrates geting an access token for an API which includes a refresh token. Additionally how to use the refresh token with AuthSession (I'm not sure if this even possible at the moment). I would imagine this is a very common use case. Simply adding the offline scope doesn't seem to work.
**Example of setting the audience. offline_access does not work however**
```
const [request, result, promptAsync] = AuthSession.useAuthRequest(
{
redirectUri,
clientId: auth0ClientId,
// id_token will return a JWT token
responseType: "id_token token",
// retrieve the user's profile
scopes: ["offline_access","openid", "profile"],
extraParams: {
// ideally, this will be a random value
nonce: "nonce",
audience: "YOUR-API-AUDIENCE-ID-HERE"
},
},
{ authorizationEndpoint }
);
```
Contributor guide
Assessment
This issue has not been assessed yet.