Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Pages - Customize & Extend
Unanswered

What are secure options for calling external APIs from portal?

(0) ShareShare
ReportReport
Posted on by

So I have done some research (both within the community as well as on Google), and I am a bit lost as to what viable options are for calling external APIs from a portal.

 

My requirement (apart from basic GETs) is to have something like a form with input fields that sends a request when the form is submitted based on the logged in user.

 

I have tried several things, each with their own limitations:

 

  • Custom connector
    • Works well for GET requests but stores the data in DataVerse which is not ideal and not suitable for POST/PUT
  • Power Automate (Trigger a flow from the portal with a HTTP request)
    • Works but trigger the flow with clientside JS/JQuery allows the user to reverse engineer the API call
  • Custom JS/Jquery/Ajax
    • Same issue as above. Client side API calls are basically a no-go
  • Custom PCF
    • My test for this worked but it was very limited (I could either add the PCF control to a basic form but that requires me to relate the form with a dataverse entity). I also tried an alternative by embedding the PCF canvas app with an Iframe in the portal. This works but I don't want to be dependent on iFrames.

One of the few options left (that I currently see) is either create Power Pages form, tied to a dataverse entity, and then creating a Power Automate flow that triggers on a new dataverse record that posts the data to an external API.

 

I also haven't tried the implicit grant flow yet https://learn.microsoft.com/en-us/power-apps/maker/portals/oauth-implicit-grant-flow which seems suitable for authenticating a portal user, however, implicit grant flows are far from best practice when it comes to OAuth 2.0 based APIs.

 

Basically my question is as follows: have I exhausted all options and can I conclude that there's no standardised way to securely call external APIs from a Power Page or have I overlooked something?

Categories:
  • Peragin Profile Picture
    160 on at
    Re: What are secure options for calling external APIs from portal?

    Using the inplicit grant flow method. We wrapped the external api with Azure API management.

  • Fubar Profile Picture
    7,960 Super User 2025 Season 1 on at
    Re: What are secure options for calling external APIs from portal?

    The mechanism provided by the portal to allow you to achieve this is the Implicit Grant Flow. The others are alternatives but have differing degrees of issues with regards to security.

     

    Another way is to custom code something i.e. plugin or custom workflow activity or Action.  The trick with this is being able to trigger it and get the response back up to the Portal - but it is doable (but you only have a 2 min time limit) - there used to be a trick where you would do the return JSON from Web Page via custom Web Tempalate, in the custom Web Template you would have FetchXML to read a custom entity, plugin registered on retrieve/retrievemultiple, the plugin would hijack the FetchXML call and inject its own output into the query results (there's a article on the web somewhere - but not sure where).

    There are also possibly other tricks for the plugin type approach, such as if you can get the user to update a record, on submit redirect to another page, use that update as the trigger for your code and update that record (big multi line text etc) in real-time, then on the page you redirected them to the response will be in the field you updated.

     

    Believe they are also working on letting you make a Web API call to run an Action.

     

    Most other options you have to try an implement some security to ensure that what you are calling is coming from your Portal users and not a malicious actor.

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >

Featured topics