Distinguish between the OAuth login with and without user interaction

Kokul Jose 311 Reputation points
2020-08-04T01:25:01.013+00:00

I would like to give a sign in successful message if user have clicked the sign card to sign in else i do not need the same. So here i need to identify that how the sign in happened. How can i distinguish between the two types of activities in bot framework?

Azure AI Bot Service
Azure AI Bot Service
An Azure service that provides an integrated environment for bot development.
756 questions
{count} votes

Accepted answer
  1. Destin Joy 1,866 Reputation points
    2020-08-08T17:29:41.993+00:00

    I think the best way is to find the Activity Type if its event type user have interacted else it’s an automatic signin. You can reverify the connection just established by checking the value of key connectionName in Activity.Value. The following code will help you.

    2 people found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Destin Joy 1,866 Reputation points
    2020-08-08T17:30:57.147+00:00

    string output = JsonConvert.SerializeObject(stepContext.Context.Activity.Value, Formatting.Indented);

    if (stepContext.Context.Activity.Type is "event")

                {
    
                    var conName = JsonConvert.DeserializeObject<JObject>(output)["connectionName"].ToString();
    
      
    
    2 people found this answer helpful.