Option to refresh token in getRoles
- Dominant language
- No language data
- Stars
- 346
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
**Is your feature request related to a problem? Please describe.**
Azure Static Web App does offer a way to get access token for role management via "roleSource" which reference to commonly named endpoint "/api/getRoles".
The payload received in the endpoint from Entra only consists `accessToken` and no refresh token. Thus, if the static web app is left closed for a while, the existing login session will be expired. When user goes back and login again, Entra send the token again, however the token is expired and there is no way yet to refresh the token, from my understandings.
**Describe the solution you'd like**
I think if this can be handled by a workaround, it would be great to have this documented in the official document.
Alternatively, the refresh token can be provided to get new access token in `getRoles` endpoint.
**Additional context**
For example, when using the access token to POST to `https://graph.microsoft.com/v1.0/directoryObjects/{user_id}/getMemberGroups`, it will results after next relogin (not fully logout but because of expired login session)
```
{"error":{"code":"InvalidAuthenticationToken","message":"Lifetime validation failed, the token is expired.","innerError":{"date":"2025-05-26T21:35:30","request-id":"******-a791-4cad-912d-******","client-request-id":"******-a791-4cad-912d-*******"}}}
````
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.