Forum Discussion

Lakshmi_145's avatar
Lakshmi_145
Iron Contributor
Jul 11, 2023

Oauth Prompt sign in is success even if we provide wrong value

I am working on a Bot framework project. We are using Oauth prompt sign-in card for validation in the directline channel. In Chrome incognito, validation code is displayed after sign in,

Validation is getting success even if we provide  " 134936123456789 " instead of " 134936 "

Is there any other validation which we needs to do in code to block the extra numbers in the code.

Validation will fail if we miss any number or add any number in between the code  " 134936 "

 

Example :

Validation Failed Code :  " 134836 " 

 

15 Replies

    • Lakshmi_145's avatar
      Lakshmi_145
      Iron Contributor

      Prasad_Das-MSFT 

       

      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_145's avatar
        Lakshmi_145
        Iron 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 

Resources