Forum Discussion
Oauth Prompt sign in is success even if we provide wrong value
We have added the below OAuthPrompt to waterfall dialog.
AddDialog(new OAuthPrompt(
nameof(OAuthPrompt),
new OAuthPromptSettings
{
ConnectionName = ConnectionName,
Text = "Please Sign In",
Title = "Sign In",
Timeout = 300000
}));
private async Task<DialogTurnResult> PromptStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken)
{
return await stepContext.BeginDialogAsync(nameof(OAuthPrompt), null, cancellationToken);
}
private async Task<DialogTurnResult> LoginStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken)
{
// Get the token from the previous step.
var tokenResponse = (TokenResponse)stepContext.Result;
if (tokenResponse?.Token != null)
{
//Here token response is not null even if we provide extra numbers after the actual validation code
}
}
Prasad_Das-MSFT is there any update on this issue. Do we have any other methods to validate the length of the validation code
- Prasad_Das-MSFTJul 14, 2023
Microsoft
Lakshmi_145 - We checked this sample (Microsoft-Teams-Samples/samples/bot-teams-authentication/csharp at main · OfficeDev/Microsoft-Teams-Samples · GitHub), however in this sample we are getting OAuth card to sign in and after entering creds, it is getting successfully signed in and sending the token.
We were not able to implement the logic to get validation code as you got in browser.- Lakshmi_145Jul 14, 2023Iron Contributor
Yes, we are also getting the sigin card and verification code.
The issue is if we give extra number also with the verification code, it takes as valid data.
If the actual verification code is 123456 and in the bot I gave 123456789211, still we are able to fetch the valid token from token response
- Prasad_Das-MSFTJul 14, 2023
Microsoft
Lakshmi_145 - I meant to say in earlier reply is "We were not able to implement the logic to get validation code as you got in browser". Could you please let us know how to get that?