Closed kshyambabu closed 4 years ago
Yes, the oauth prompt will help you refresh token. Note: please do not store the token by yourself, when you want to use token, get it from oauth prompt. Then it will help you manage your token.
I am using the settings as described below, I should not give login card every time token expires. Do I need to set extra configuration for OAuth prompt to get the refresh token without prompting to user login again?
@DingmaomaoBJTU can you please explain a bit further on how to refresh tokens using the oAuth prompt.
i understand the access token can be retrived from the oAuth prompt but, how does one refresh tokens.
our scenario is we authenticate users against AAD and once authenticated the user will be using the bot for an extended period of time.
given the scenario what is the recommended approach to handle token expiration. (asking the user with oauth prompt often would be a bad experience)
The logic of oauth prompt is like this: 1) retrieve token from service 2) if failed, prompt. When in step 1, the service help you refresh token and always return a useful token if user log in. There is nothing special to set for OAuth prompt (the only thing you need to notice is don't enable the alwaysPrompt flag). So that means, if a user is log in, the OAuth Prompt won't prompt, if user is not log in, the OAuth prompt will prompt. It does not prompt everytime. So be free to add many OAuth prompts in your flow.
Please have a try, if oauth prompt not work as expect, you can log a bug for us~
Not sure whether I'm fully understand what you required. Please add more comments if there is any.
And here is the official doc, you can take a look~
@DingmaomaoBJTU Thanks. The answer gave us the insight on how to use OAuth prompt and how it is performing internally.
Hi, I am implementing authentication for Active directory v2. Authentication is going pretty well and recieving the token, But not getting the refresh token. The access token is expiring in 1 hour.