From 055d1ea4182e22e9d1a61c7b84635e83ae3aa3cc Mon Sep 17 00:00:00 2001 From: Marius Wodtke Date: Sat, 29 Jun 2024 20:37:33 +0200 Subject: [PATCH 1/3] Correcting Article on Microsoft Authentication Provider. It said to use the secret id as client secret, but by own testing and [this discussion](https://powerusers.microsoft.com/t5/General-Discussions/Microsoft-LogIn-Unable-to-authenticate-with-external-account/m-p/2363622/highlight/true#M4637) this is wrong. --- power-pages-docs/security/authentication/oauth2-microsoft.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/power-pages-docs/security/authentication/oauth2-microsoft.md b/power-pages-docs/security/authentication/oauth2-microsoft.md index ea9de53e5..f79c87f1b 100644 --- a/power-pages-docs/security/authentication/oauth2-microsoft.md +++ b/power-pages-docs/security/authentication/oauth2-microsoft.md @@ -68,7 +68,7 @@ Set Microsoft as an identity provider for your site. 1. Enter an optional description, select an expiration, and then select **Add**. -1. Under **Secret ID**, select the **Copy to clipboard** icon. +1. Under **Secret Value**, select the **Copy to clipboard** icon. ## Enter site settings in Power Pages @@ -77,7 +77,7 @@ Set Microsoft as an identity provider for your site. 1. Under **Configure site settings**, paste the following values: - **Client ID​**: Paste the **Application (client) ID** [you copied](#create-a-microsoft-app-registration-in-azure). - - **Client secret**: Paste the **Secret ID** you copied. + - **Client secret**: Paste the **Secret Value** you copied. [Optional additional settings for OAuth 2.0 identity providers](oauth2-settings.md) From 1fc0a6214dc3b045caa98389b6ad5909239e43d9 Mon Sep 17 00:00:00 2001 From: Marius Wodtke Date: Fri, 26 Jul 2024 19:35:40 +0200 Subject: [PATCH 2/3] Add notes for cloud flows --- power-pages-docs/configure/cloud-flow-integration.md | 8 ++++++-- power-pages-docs/configure/power-automate-how-to.md | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/power-pages-docs/configure/cloud-flow-integration.md b/power-pages-docs/configure/cloud-flow-integration.md index 25d2bcb62..8b466db45 100644 --- a/power-pages-docs/configure/cloud-flow-integration.md +++ b/power-pages-docs/configure/cloud-flow-integration.md @@ -97,7 +97,7 @@ Request ```html POST https://contoso.powerappsportals.com/_api/cloudflow/v1.0/trigger/4d22a1a2-8a67-e681-9985-3f36acfb8ed4 { - "Location":"Seattle" + "eventData": "{\"Location\":\"Seattle\"}" } ``` @@ -124,6 +124,9 @@ Body } ``` +> [!NOTE] +> Output parameters are returned with lowercase names, no matter what casing was used in the cloud flow. + ## Authenticating cloud flow API requests You don't need to include an authentication code, because the application session manages authentication and authorization. All API calls must include a Cross-Site Request Forgery (CSRF) token. @@ -144,6 +147,7 @@ This sample demonstrates how to call a flow using Asynchronous JavaScript and XM shell.ajaxSafePost({ type: "POST", url: "/_api/cloudflow/v1.0/trigger/44a4b2f2-0d1a-4820-bf93-9376278d49c4", + contentType: "application/json", data: JSON.stringify({"eventData":JSON.stringify({"Email": "abc@contoso.com", "File":{"name":"Report.pdf", "contentBytes":"base 64 encoded string"} })}) }) .done(function (response) { @@ -154,5 +158,5 @@ This sample demonstrates how to call a flow using Asynchronous JavaScript and XM }); ``` > [!NOTE] -> - If no input parameter is defined in the trigger, pass an empty payload in the request. +> - If no input parameter is defined in the trigger, pass a payload with empty eventData in the request (`data: JSON.stringify({"eventData":JSON.stringify({})})`). > - For information on cloud flow limitations, see [Limits of automated, scheduled, and instant flows](/power-automate/limits-and-config). diff --git a/power-pages-docs/configure/power-automate-how-to.md b/power-pages-docs/configure/power-automate-how-to.md index 7c8cf6e8d..5e492681c 100644 --- a/power-pages-docs/configure/power-automate-how-to.md +++ b/power-pages-docs/configure/power-automate-how-to.md @@ -268,6 +268,7 @@ After creating the flow and attaching it to the Power Pages site, you can now ca .ajaxSafePost({ type: "POST", url: _url, + contentType: "application/json", data: JSON.stringify(payload) }) .done(function (response) { From 1c81458642fe14aa496cb3315c088c56bd565d2c Mon Sep 17 00:00:00 2001 From: Marius Wodtke Date: Fri, 26 Jul 2024 19:35:55 +0200 Subject: [PATCH 3/3] Revert "Correcting Article on Microsoft Authentication Provider. It said to use the secret id as client secret, but by own testing and [this discussion](https://powerusers.microsoft.com/t5/General-Discussions/Microsoft-LogIn-Unable-to-authenticate-with-external-account/m-p/2363622/highlight/true#M4637) this is wrong." This reverts commit 055d1ea4182e22e9d1a61c7b84635e83ae3aa3cc. --- power-pages-docs/security/authentication/oauth2-microsoft.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/power-pages-docs/security/authentication/oauth2-microsoft.md b/power-pages-docs/security/authentication/oauth2-microsoft.md index f79c87f1b..ea9de53e5 100644 --- a/power-pages-docs/security/authentication/oauth2-microsoft.md +++ b/power-pages-docs/security/authentication/oauth2-microsoft.md @@ -68,7 +68,7 @@ Set Microsoft as an identity provider for your site. 1. Enter an optional description, select an expiration, and then select **Add**. -1. Under **Secret Value**, select the **Copy to clipboard** icon. +1. Under **Secret ID**, select the **Copy to clipboard** icon. ## Enter site settings in Power Pages @@ -77,7 +77,7 @@ Set Microsoft as an identity provider for your site. 1. Under **Configure site settings**, paste the following values: - **Client ID​**: Paste the **Application (client) ID** [you copied](#create-a-microsoft-app-registration-in-azure). - - **Client secret**: Paste the **Secret Value** you copied. + - **Client secret**: Paste the **Secret ID** you copied. [Optional additional settings for OAuth 2.0 identity providers](oauth2-settings.md)