- 
                Notifications
    
You must be signed in to change notification settings  - Fork 492
 
Closed
Labels
BF Customer Ask"Convenience" asks made by our customers and don’t accrue to any major feature"Convenience" asks made by our customers and don’t accrue to any major featureP1Painful if we don't fix, won't block releasingPainful if we don't fix, won't block releasingbugIndicates an unexpected problem or an unintended behavior.Indicates an unexpected problem or an unintended behavior.investigateNeeds more information in order to proceedNeeds more information in order to proceed
Milestone
Description
Version
4.8.0
Describe the bug
OAuthPromptSettings has a Timeout that you can set to control how much time the user has to complete the auth flow. But in Teams, the timeout doesn't work. The authentication flow succeeds and gives a token even after the timeout duration has passed.
I'm guessing this is because the timeout logic only applies on message activities, which excludes the Teams invoke activity (see OAuthPrompt.cs):
var isMessage = dc.Context.Activity.Type == ActivityTypes.Message;
var hasTimedOut = isMessage && (DateTime.Compare(DateTime.Now, expires) > 0);To Reproduce
Steps to reproduce the behavior:
- Set up the Teams authentication sample (46.teams-auth)
 - Change the 
OAuthPrompttimeout to a smaller value, like 60000 (1 minute) - Run the sample and make the bot send the sign in card, but don't click "Sign In" yet
 - Wait for the timeout duration (or longer for good measure)
 - Click "Sign In" and complete the auth flow
 - The 
OAuthPromptsucceeds and your bot gets a valid token 
Expected behavior
I expected the OAuthPrompt to not return a token and for Azure Bot Service to not persist the token.
Screenshots
N/A
Additional context
N/A
[bug]
stevengum
Metadata
Metadata
Assignees
Labels
BF Customer Ask"Convenience" asks made by our customers and don’t accrue to any major feature"Convenience" asks made by our customers and don’t accrue to any major featureP1Painful if we don't fix, won't block releasingPainful if we don't fix, won't block releasingbugIndicates an unexpected problem or an unintended behavior.Indicates an unexpected problem or an unintended behavior.investigateNeeds more information in order to proceedNeeds more information in order to proceed