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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Connect to Oauth2 App ...
Power Pages
Unanswered

Connect to Oauth2 App and save access Token

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hey guys! I am very new to power pages. I need your help. I want to trigger an OAuth 2.0 authorization code flow from power pages and save the access token to azure key vault or some other source from where later on I can use it in my Power Automate flows. The flow would include user interaction, as they have to trigger the flow. The overall flow is as below:

 

1. User clicks on a button on power pages to trigger the flow

2. They are redirected to a website to check if they are logged in.

3. If they are logged in, they are presented with scopes that they will be allowing access to.

4. Once they approve the scope, the rest of OAuth 2 process follows, including a code exchange and eventually access token.

5. These access token do not expire, so I would want them to be stored in azure vault or something similar, along with the user information who triggered the process.

Categories:
I have the same question (0)
  • Christian Leverenz Profile Picture
    1,214 on at

    Hi @Anonymous ,

    did not try, but may be you could setup another redirecturl for your authentication which points to a portalpage, which you have under control. Then just make another authrequest with the redirecturi to your portal. As the user is already logged in you will get immeditely a redirect with a token to your page und could parse the parameters of the request with javascript and store this data.
    May be, you could also use a diffrent applicationid or other claims in the request/response/token which are needed by your flows. Then this stored token could not be used to log in to your portal again.

    Just a thought, did not try.

     

    Have fun,

      Christian

  • Peragin Profile Picture
    160 on at

    Hi there,

     

    Storing tokens doesn't sit well with me. Is there some other way you can architect this. Maybe share the flow with them and place the data behind a custom connector that requires oauth with delegated access?

     

    Just a thought, I haven't tried this.

     

    Regards

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @chleverenz thanks for responding. I am thinking on similar lines, however, I have zero experience in web development and have hence facing difficulties in implementing this. I think I need to do a bit more research on this.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @KH_2437 . For now I am using custom connector approach. The only issue with it is since I want to build an app that many users can connect, I need to build a custom connector and respected flows to get data for each user separately. 

  • Peragin Profile Picture
    160 on at

    Please report back when you do get it working and how you did it.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
11manish Profile Picture

11manish 46

#2
Valantis Profile Picture

Valantis 24

#2
omkarsupreme Profile Picture

omkarsupreme 24

Last 30 days Overall leaderboard