Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDK method to return current access token or refresh it if expired #74

Open
quarryman opened this issue Apr 4, 2022 · 4 comments
Open

Comments

@quarryman
Copy link

Hi team.

I am trying to mimic SDK behavior available in Auth0 js client or AWS Cognito js client (Amplify), which both provide SDK method to retrieve current token or automatically refresh it silently and return refreshed one, so that one dont have to handle expiration manually.

Auth0 will always return current(refreshed if needed) token with
Auth0.getTokenSilently()

Cognito provides similar approach with
const session = await Auth.currentSession().getAccessToken();

Again, it will refresh token if expired under the hood

Is there smth similar in FusionAuth js client that will abstract getting fresh token flow into single function?

@mooreds
Copy link
Contributor

mooreds commented Apr 4, 2022

@quarryman FusionAuth's client libs are pretty close to the metal and don't currently offer that functionality.

I'd be happy to review a PR.

@quarryman
Copy link
Author

thanx for being responsive @mooreds
At this stage we are evaluating FusionAuth, I would consider PR if we find match with the library.
Thanx!

@mooreds
Copy link
Contributor

mooreds commented Apr 5, 2022

No worries, @quarryman !

We can leave this open and see if other community members chime in and want it.

@glen-84
Copy link

glen-84 commented Apr 11, 2022

We can leave this open and see if other community members chime in and want it.

We definitely want this (along with PKCE handling). I've opened #1674 since this is not specific to the TS client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants