web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / How to get PVA to auth...
Copilot Studio
Answered

How to get PVA to authenticate user in portal?

(1) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi!

 

I tried to play around with the authentication in PVA in order to achieve the successful login of a user into the portal.  Ideally, the PVA would do either one of the following...

 

* Log in the user through the PVA authentication action, parse the AuthToken variable to extract key variables (eg. Contact ID, email address), pass those variables to Flow, execute Flow to pull up contact record from CDS.

* Detect that the user has already logged into the portal outside of PVA, parse the AuthToken variable to extract key variables (eg. Contact ID, email address), pass those variables to Flow, execute Flow to pull up contact record from CDS.

 

However, despite having followed the documentation (https://docs.microsoft.com/en-us/power-virtual-agents/advanced-end-user-authentication and https://docs.microsoft.com/en-us/power-virtual-agents/configuration-end-user-authentication) and a video (https://www.youtube.com/watch?v=25tncJEBb7M) by Natraj, I am still unable to go beyond the PVA saying that login is successful.  ie. Unable to extract what's needed from the AuthToken variable, etc.

 

Has anybody successfully got the PVA to do either of the above scenarios?

Categories:
I have the same question (0)
  • CU22081450-0 Profile Picture
    Most Valuable Professional on at

    Hi @PhilipNg ,

     

    Do you have the same problem yet?

  • jpirelli Profile Picture
    Microsoft Employee on at

    I actually got this to work on the Microsoft AAD domain. In order to troubleshoot it, I had to remove the redirect so I could easily see the actual error. From there I saw my first error was related to the public auth endpoint. Instead, I needed to change from the article versions to the App specific versions as shown in my AD config. The article specifies generic names:

    https://login.microsoftonline.com/common/oauth2/v2.0/token

    https://login.microsoftonline.com/common/oauth2/v2.0/authorize

    DO NOT USE THESE

     

    I use instead as in the screenshot. Then I was able to get going. 

     

    Once authenticated, and using that redirect URL (https://token.botframework.com/.auth/web/redirect), I get a number I need to paste into the chat which is odd. I would love to make that process a bit more seamless.

     

     

  • PhilipNg Profile Picture
    Microsoft Employee on at
    Hi - thanks for the reply!

    I was also able to get the PVA to confirm authentication. It also required the entry of a number key into the chat window and then it returned a message saying that the authentication was successful.

    But then that was it. I couldn’t figure out how to parse the AuthToken variable - the documentation says that you should be able to pass that into Flow to pull up contact info but doesn’t specify what’s actually stored in that variable. I’d imagine that in Flow, a HTTP Request trigger would be needed with JSON to identify the object(s) that can be linked to the variable. If anybody has an example of how they progressed beyond that initial success message, that would be appreciated!
  • jpirelli Profile Picture
    Microsoft Employee on at

    You will not be decrypting that token directly. You will use that token to get more info. I have a guy on our team chasing this down to sort out how to pass the creds. I expect he'll get it figured out pretty quickly assuming his day-job isn't keeping him from working on it.

     

    I'll report back with our findings!

    Thanks

    Joe

  • PhilipNg Profile Picture
    Microsoft Employee on at

    Hi, Joe:

     

    Thanks for the clarification - looking forward to any results that you find!

  • CleberM Profile Picture
    on at

    Hi @PhilipNg ,

    Thanks for the question. Like @jpirelli  said, you will use the token to get more information. This is usually done by passing the token into an API that gets user information, or takes actions on the users' behalf.

     

    In this case, you can pass the token to a Power Automate flow, which can make a call to an API. 

     

    Regarding the number code that you need to paste in, that's an additional security measure. We are planning on removing this requirement by adding a URL inclusion list configuration (so it's only permitted to login on certain URLs like your portal), so the security is not compromised. This is being considered for a future release.

     

    Thanks

  • Verified answer
    PhilipNg Profile Picture
    Microsoft Employee on at

    Finally got it working this morning!  Steps described in the attached document.

  • CU22081450-0 Profile Picture
    Most Valuable Professional on at

    Really cool work @PhilipNg , congratulations!!!

  • Vidanaw Profile Picture
    179 on at

    @PhilipNg 

    Thank you very much for providing us details. I have followed all your instructions, but I m getting an error as attached.

    What I m trying to do is creating an MS Teams using Power Virtual agent.

    Please see the attached Flow and Error. 

    Could you please help me to resolve the issue. 

    Thanks.

  • CU22081450-0 Profile Picture
    Most Valuable Professional on at

    Hi @Vidanaw ,

     

    Can you send more details and prints about the Flow error?

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Copilot Studio

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 251 Super User 2025 Season 2

#2
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 201 Super User 2025 Season 2

#3
S-Venkadesh Profile Picture

S-Venkadesh 93 Moderator

Last 30 days Overall leaderboard