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 / Power Automate / Retrieve user informat...
Power Automate
Unanswered

Retrieve user information from HTTP Request trigger when message comes from actionable email

(1) ShareShare
ReportReport
Posted on by 18

I was having an issue figuring out where a request was coming from. A user would receive an actionable email and click on a specific action (Close or Ignore). This action would trigger a flow, but I had no way to know who triggered the flow as HTTP triggers don't require any kind of authentication.

 

As it turns out, the header contains a property called "Action-Authorization". This is a jwt token. By splitting it into the three parts of a jwt token, you can get the "sub" property from the Payload section (the second section). This contains the email address of the person who received the actionable email.

 

Header schema:

{
 "type": "object",
 "properties": {
 "Connection": {
 "type": "string"
 },
 "Expect": {
 "type": "string"
 },
 "Host": {
 "type": "string"
 },
 "User-Agent": {
 "type": "string"
 },
 "Card-Correlation-Id": {
 "type": "string"
 },
 "Message-Id": {
 "type": "string"
 },
 "Action-Request-Id": {
 "type": "string"
 },
 "Identity-Linking-Redirect-Url": {
 "type": "string"
 },
 "Action-Authorization": {
 "type": "string"
 },
 "Content-Length": {
 "type": "string"
 },
 "Content-Type": {
 "type": "string"
 }
 }
}

 

You'll need to strip the "Bearer " value from the header value to get just the token:

 

replace(body('Parse_Header')?['Action-Authorization'],'Bearer ','')

 

Then you split the token to get just the second section:

 

split(variables('ActionAuth'),'.')[1]

 

Finally, parse:

 

{
 "type": "object",
 "properties": {
 "iat": {
 "type": "integer"
 },
 "ver": {
 "type": "string"
 },
 "appid": {
 "type": "string"
 },
 "sub": {
 "type": "string"
 },
 "appidacr": {
 "type": "string"
 },
 "acr": {
 "type": "string"
 },
 "tid": {
 "type": "string"
 },
 "sender": {
 "type": "string"
 },
 "oid": {
 "type": "string"
 },
 "iss": {
 "type": "string"
 },
 "aud": {
 "type": "string"
 },
 "exp": {
 "type": "integer"
 },
 "nbf": {
 "type": "integer"
 }
 }
}

 

The resulting value "sub" is the email address of the sender.

Categories:
I have the same question (0)
  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @randyslavey 

     

    Not sure what you looking for? Yes you explained well about JSON schema and getting the email address.

  • randyslavey Profile Picture
    18 on at

    I didn't see a post that explained what I needed to do, so I thought I'd share what I went through to solve it. Don't really need help; it was more of a "share for the community" thing. Wasn't sure where else to post it.

  • matt5000000 Profile Picture
    2 on at

    could you explain how you would add this to a flow? Ie, what action would you use to 'strip the bearer value from the header value' or 'split the token to get just the second section'. Then what are you using to @'parse'?

     

    Also, how do you call this information within the flow? will it just show up as sub, to be used in the send an email v2???

     

    Thank you in advance

  • BrandenF21 Profile Picture
    2 on at

    Hi @randyslavey ,

     

    Thank you for this post. Would you be willing to share some screenshots of the flow? I have a similar use case but I need a better understanding of how this was implemented. Thanks.

     

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 > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard