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 parse auth toke...
Copilot Studio
Unanswered

How to parse auth token and get user details in PVA bot?

(2) ShareShare
ReportReport
Posted on by
  1. I have configured user auth as mentioned here on my PVA bot.
  2. I have configured Flow to send a token from PVA bot to flow.
  3. I am able to verify that my flow is able to receive a token ( after user sign in ) from PVA variable. ( seen in the screenshot bellow. )
  4. I would like to know how can I parse this token and, get the user details of sign in user? I know I can call all MS graph APIs using this token but, that is not I am trying to do here.
  5. I would like to parse this token, something like what https://jwt.io/ does.

 

Screen Shot 2020-03-19 at 2.45.40 PM.pngScreen Shot 2020-03-19 at 2.48.52 PM.pngScreen Shot 2020-03-19 at 2.51.49 PM.png

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

    Hi @Anonymous ,

     

    The unique way to do it is by calling the Power Automate passing the AuthToken and inside your Power Automate, call back-end APIs to get more details related to the user.

    I recommend that call the MS Graph to get more details, it is an easy and great way.

    https://docs.microsoft.com/en-us/power-virtual-agents/advanced-end-user-authentication#authtoken-variable

     

    ---
    If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

    Thanks!
    Renato Romão
    https://www.linkedin.com/in/renatoromao/

  • Community Power Platform Member Profile Picture
    on at

    What the specific graph api we should use to fetch the user details from token?

  • CU22081450-0 Profile Picture
    Most Valuable Professional on at

    @Anonymous ,

     

    This one: https://docs.microsoft.com/en-us/graph/api/user-get?view=graph-rest-1.0&tabs=http

     

    ---
    If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

    Thanks!
    Renato Romão
    https://www.linkedin.com/in/renatoromao/

  • Verified answer
    CU22081450-0 Profile Picture
    Most Valuable Professional on at

    Hi @Anonymous ,

     

    Did I answer your question?

    If yes, please give kudos. And if this solves your problem, please accept this reply as the solution.

     

    -----

    Thanks!
    Renato Romão
    https://www.linkedin.com/in/renatoromao/

  • POJA85 Profile Picture
    on at

    Hello @Anonymous .

     

    I am struggling with exactly the same case as you, did you find a solution to this issue? 

     

    I tried to suggestion to use graph api and call https://graph.microsoft.com/v1.0/me with the token but I get error:

    {
      "error": {
        "code""InvalidAuthenticationToken",
        "message""Access token validation failure. Invalid audience.",
        "innerError": {
          "date""2020-06-19T12:57:36",
          "request-id""ed87e114-ffe2-4ae2-b52c-5e41774ae2ff"
        }
      }
    }
  • POJA85 Profile Picture
    on at

    As a solution I setup a Azure function to take the token, decode it and used regex to retrieve the value I needed. 

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 255 Super User 2025 Season 2

#2
Romain The Low-Code Bearded Bear Profile Picture

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

#3
S-Venkadesh Profile Picture

S-Venkadesh 101 Moderator

Last 30 days Overall leaderboard