Skip to main content

Notifications

Topic Creation & Management
Unanswered

Authentication within a topic often fails

Posted on by

In brief

I have created a PVA with authentication inside a topic ("on canvas").  The authentication step works most of the time, but fails often enough to be unusable.

Manage Security

I set the Authentication to be Manual (for any channel includig Teams) and I did not check the checkbox "Require users to log in".  The behaviour I'm after is that an anonymous user may call the topic, and we will ask them to log in if they choose a particular path through the topic

In-Topic authentication behaviour

We have an authentication step within the topic.  After publishing the PVA, we then test this using the demo website link on the Publish page.

Most times it works as expected, so:

  • The user types in the trigger phrase to start the Topic
  • The user is presented with a [Login] button
  • On clicking the button the user authenticates (if not already done so) and then gets presented with a magic code
  • They copy/paste the magic code into the PVA
  • They then execute the flow for the condition where `bot.IsLoggedIn` is true

However, occassionally this doesn't work and it's frequent enough to make this unusable....

 

Here, the flow is:

  • The user types in the trigger phrase to start the Topic
  • The user is presented with a [Login] button
  • On clicking the button the user authenticates (if not already done so) and then gets presented with a magic code
  • They paste the magic code into the PVA
  • However, now they execute the condition where `bot.IsLoggedIn` is false
    • If we echo back all the authentication properties then we see:
    • bot.AuthToken is the long string
    • bot.IsloggedIn is false
    • bot.UserDisplayName is the expected user's name
    • bot.UserId is aGuid
  • If we now re-type the trigger phrase to restart the Topic, we then immediately execute the flow for the condition where `bot.IsLoggedIn` is true

So, initially authentication fails because the user is marked as not logged in, but we're able to see the user's name.  And when re-triggering the same topic immediately afterwards, then the user is marked as logged in.

 

It seems from my perspective to be a timing issue...?

 

I have tested this with different PVAs in different tenant environments.  Same level of fragility and same symptoms.

Categories:
  • SupportBryn Profile Picture
    SupportBryn on at
    Re: Authentication within a topic often fails

    Hey @DrJGriff,

     

    This sounds like a fairly complicated issue, probably not one that could be solved without some direct insight into your bot's particular setup and some dedicated troubleshooting time. If you haven't already done so, I'd highly recommend opening a support ticket to address this, as the forums are often used for the solving of simpler problems, and you may be better served by finding a dedicated support agent for the issue.

     

    Thank you for using Microsoft Power Platform Communities!

    Bryn Baker

    Support Engineer

    Microsoft Power Platform

    If this post helps, then please consider accepting it as the solution to help other members find it more quickly! Have a great day!

Helpful resources

Quick Links

Exciting News for Copilot Studio Communi…

Get ready to experience a whole new level of engagement with the Copilot Studio…

Celebrating the May Super User of the…

LaurensM is an exceptional contributor to the Power Platform Community…

Check out the Copilot Studio Cookbook…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
renatoromao Profile Picture

renatoromao 6,459

#2
Pstork1 Profile Picture

Pstork1 1,990

#3
Expiscornovus Profile Picture

Expiscornovus 1,700

Featured topics