Forum Discussion
Oauth Prompt sign in is success even if we provide wrong value
Lakshmi_145 -Could you please provide the sample you are referring to along with repro steps and code snippets?
- Lakshmi_145Jul 12, 2023Iron Contributor
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
}
}
- Lakshmi_145Jul 14, 2023Iron Contributor
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.