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

[Feature Request] refresh_in #176

Closed
henrik-me opened this issue Mar 18, 2020 · 5 comments · Fixed by #312
Closed

[Feature Request] refresh_in #176

henrik-me opened this issue Mar 18, 2020 · 5 comments · Fixed by #312

Comments

@henrik-me
Copy link

Refresh_In (token response) support.
This feature allows the service to control when MSAL should attempt to refresh the access token (ahead of its expiration)

API Review

@lzw-all-in
Copy link

Hi @henrik-me I just have the same request. I need to get new valid access token through my refresh token.

@rayluo
Copy link
Collaborator

rayluo commented Mar 20, 2020

@lzw-all-in , you can already get a new valid access token through using acquire_token_silent(). Please refer to the 3-step pattern described in our README, and then you can read our API Reference located at the header line in our repo.

This feature described here is for msal to FURTHER improve our INTERNAL refresh logic, but that is transparent to you as an app developer. Yoiu are NOT blocked by this feature.

@lzw-all-in
Copy link

lzw-all-in commented Mar 23, 2020

@rayluo Thank you. I saw the usage and source code before but what I need is the api I can pass refresh token as a parameter to get the newest access token.

Update:
I use Oauth2 api to do this not MSAL directly.

@rayluo
Copy link
Collaborator

rayluo commented Mar 23, 2020

@lzw-all-in , do you intend to "use oauth2 api" but still connect with Microsoft identity platform (i.e. Azure Active Directory)? If so, MSAL is designed to be easier than using generic OAuth2 library. Or if you have any specific need to handle refresh token yourself, I would be curious to hear that.

Either way, that would be a different topic which does not belong to this Feature Request. Feel free to create a separated issue, and/or send email to me. Thanks.

@lzw-all-in
Copy link

@rayluo Yes I saw MSAL api doesn't support given refresh token to attain the newest access token. I use the api obtain_token_by_refresh_token supported by oauth2 Client class.
Because for every client who use my app service I can get their access token and refresh token. And every time when I found the access token is failed then I will use this user's refresh token to get a new one.

result = Azureapp.client.obtain_token_by_refresh_token(
            token_item={"refresh_token" : refresh_token},
            scope=app_config.RESOURCE)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
3 participants