Skip to main content

Notifications

Copilot Studio - Topic Creation & Management
Suggested answer

Power Pages Agent: IsLoggedIn shows true all the time

Posted on by 4
I have turned on the latest Power Pages Copilot and I am working with the SignIn/Authenticate process.
 
After enabling I went to the Copilot Studio and checked the new Agent that was created.  In the Test area, the bot is asking me to "Login" which does not work because there is a disconnect between Studio and Power Pages.  I am fine with that though i would hope Microsoft will eventually fix this issue so we can test Power Pages functionality from the Studio test environment (Time Consuming publishing for every test).
 
Moving over to Power Pages testing:  Somewhere in the background Copilot is calling the SignIn Topic (If I remove it, it will state it is missing and if I add a SendMessage, I can see the message).  One of the messages I added had the User.IsloggedIn variable and it comes back with "Yes" whether or not the Power Pages user is logged in.
 
I can't see the backend Authentication Action so I am assuming it is using this variable to determine if it should make the User Log in.
I also cannot set the variable (Thought if I could set it to False if the User.DisplayName = (Blank) then that may solve the issue.
 
I tried to follow the IsloggedIn through the Browser Debug and from what I can see, the variable is false for most of the journey but my dubbing skills are not that of a developer so I do lose it prior to it getting the Send Message where it says "Yes"
 
Anyone have any idea?
Is this a bug or is there something I am missing?
 
For a workaround, I am just asking them to sign in using the actual Power Pages sign in but it is clunky as it restarts the Bot.
Categories:
  • Suggested answer
    PM-20111707-0 Profile Picture
    PM-20111707-0 4 on at
    Power Pages Agent: IsLoggedIn shows true all the time
    SaiRT14 Thank you for your post and sorry for the delay in reply, I was trying to research some of your comments.
     
    Agreed, there is something not performing correctly in the backend.
     
    "Since Copilot relies on the portal's authentication status, use the Power Pages sign-in mechanism to establish the user session before engaging with the bot."
     
    This is the Out-of-Box Copilot integration for Power Pages, I don't see any configuration for stopping the bot from showing (Engaging) prior to login... And if there was, then the bot would not be able to tell the user to sign in.
     
     
    "Ensure the sign-in page is correctly configured in Power Pages: Go to Portal Management > Web Pages. Verify the sign-in page's URL and logic."
     
    Seems to be.  Username/pass or use Azure shows up... I think this info is on a Snippet
     
     
    "Prompt users to sign in if User.IsLoggedIn = False. - "Welcome! Please [sign in](<sign-in URL>) to continue."
    Save the user's interaction context in a variable and reinitialize the bot's flow after login."
     
    That is the underlying issue:  User.IsLoggedIn always shows True whether the user is logged into the portal or not... The only field that seems to work is User.Id (Which is what I am currently using to check if the user is logged in - If it equals "00000000-0000-0000-0000-000000000000", then the user is not logged in.  I do like the idea of adding the Sign-In link directly into the bot although it does open a new page and could get confusing to the user.  That is why the process that it looks like Microsoft was going for with the actual Authentication Creds right in the bot window would have been perfect.
     
    I will continue to research... Thanks again
  • Suggested answer
    SaiRT14 Profile Picture
    SaiRT14 1,318 on at
    Power Pages Agent: IsLoggedIn shows true all the time

    The behavior you're experiencing with Power Pages Copilot regarding the User.IsLoggedIn variable and the sign-in process seems to stem from a combination of limitations in how Copilot integrates with the Power Pages authentication flow and potential quirks in the User.IsLoggedIn variable's evaluation.

    Since Copilot relies on the portal's authentication status, use the Power Pages sign-in mechanism to establish the user session before engaging with the bot.

    Ensure the sign-in page is correctly configured in Power Pages: Go to Portal Management > Web Pages. Verify the sign-in page's URL and logic.

    Prompt users to sign in if User.IsLoggedIn = False. - "Welcome! Please [sign in](<sign-in URL>) to continue."
    Save the user's interaction context in a variable and reinitialize the bot's flow after login.

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,532

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,050

Leaderboard

Featured topics