Skip to content

Commit 2055278

Browse files
authored
Merge pull request #245404 from ecfan/authentication
Azure Logic Apps: Update for Proof-of-Possession (PoP) access token for Azure AD (8/7/2023)
2 parents e9ff86d + 9516d45 commit 2055278

File tree

4 files changed

+45
-27
lines changed

4 files changed

+45
-27
lines changed

articles/logic-apps/logic-apps-securing-a-logic-app.md

Lines changed: 45 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -725,29 +725,7 @@ In a Standard logic app workflow that starts with the Request trigger (but not a
725725

726726
* An inbound call to the request endpoint can use only one authorization scheme, either Azure AD OAuth or [Shared Access Signature (SAS)](#sas). Although using one scheme doesn't disable the other scheme, using both schemes at the same time causes an error because Azure Logic Apps doesn't know which scheme to choose.
727727

728-
To enable Azure AD OAuth so that this option is the only way to call the request endpoint, use the following steps:
729-
730-
1. To enable the capability to check the OAuth access token, [follow the steps to include 'Authorization' header in the Request or HTTP webhook trigger outputs](#include-auth-header).
731-
732-
> [!NOTE]
733-
>
734-
> This step makes the `Authorization` header visible in the workflow's run history
735-
> and in the trigger's outputs.
736-
737-
1. In the [Azure portal](https://portal.azure.com), open your Consumption logic app workflow in the designer.
738-
739-
1. On the trigger, in the upper right corner, select the ellipses (**...**) button, and then select **Settings**.
740-
741-
1. Under **Trigger Conditions**, select **Add**. In the trigger condition box, enter the following expression, and select **Done**.
742-
743-
`@startsWith(triggerOutputs()?['headers']?['Authorization'], 'Bearer')`
744-
745-
> [!NOTE]
746-
> If you call the trigger endpoint without the correct authorization,
747-
> the run history just shows the trigger as `Skipped` without any
748-
> message that the trigger condition has failed.
749-
750-
* Only [Bearer-type](../active-directory/develop/active-directory-v2-protocols.md#tokens) authorization schemes are supported for Azure AD OAuth access tokens, which means that the `Authorization` header for the access token must specify the `Bearer` type.
728+
* Azure Logic Apps supports either the [bearer type](../active-directory/develop/active-directory-v2-protocols.md#tokens) or [proof-of-possession type (Consumption logic app only)](/entra/msal/dotnet/advanced/proof-of-possession-tokens) authorization schemes for Azure AD OAuth access tokens. However, the `Authorization` header for the access token must specify either the `Bearer` type or `PoP` type. For more information about how to get and use a PoP token, see [Get a Proof of Possession (PoP) token](#get-pop).
751729

752730
* Your logic app resource is limited to a maximum number of authorization policies. Each authorization policy also has a maximum number of [claims](../active-directory/develop/developer-glossary.md#claim). For more information, review [Limits and configuration for Azure Logic Apps](../logic-apps/logic-apps-limits-and-config.md#authentication-limits).
753731

@@ -796,6 +774,41 @@ In a Standard logic app workflow that starts with the Request trigger (but not a
796774
}
797775
```
798776

777+
#### Enable Azure AD OAuth as the only option to call a request endpoint
778+
779+
1. Set up your Request or HTTP webhook trigger with the capability to check the OAuth access token by [following the steps to include the 'Authorization' header in the Request or HTTP webhook trigger outputs](#include-auth-header).
780+
781+
> [!NOTE]
782+
>
783+
> This step makes the `Authorization` header visible in the
784+
> workflow's run history and in the trigger's outputs.
785+
786+
1. In the [Azure portal](https://portal.azure.com), open your Consumption logic app workflow in the designer.
787+
788+
1. On the trigger, in the upper right corner, select the ellipses (**...**) button, and then select **Settings**.
789+
790+
1. Under **Trigger Conditions**, select **Add**. In the trigger condition box, enter either of the following expressions, based on the token type you want to use, and select **Done**.
791+
792+
`@startsWith(triggerOutputs()?['headers']?['Authorization'], 'Bearer')`
793+
794+
-or-
795+
796+
`@startsWith(triggerOutputs()?['headers']?['Authorization'], 'PoP')`
797+
798+
If you call the trigger endpoint without the correct authorization, the run history just shows the trigger as `Skipped` without any message that the trigger condition has failed.
799+
800+
<a name="get-pop"></a>
801+
802+
#### Get a Proof-of-Possession (PoP) token
803+
804+
The Microsoft Authentication Library (MSAL) libraries provide PoP tokens for you to use. If the logic app workflow that you want to call requires a PoP token, you can get this token using the MSAL libraries. The following samples show how to acquire PoP tokens:
805+
806+
* [A .NET Core daemon console application calling a protected Web API with its own identity](https://github.com/Azure-Samples/active-directory-dotnetcore-daemon-v2/tree/master/2-Call-OwnApi)
807+
808+
* [SignedHttpRequest aka PoP (Proof of Possession)](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/wiki/SignedHttpRequest-aka-PoP-(Proof-of-Possession))
809+
810+
To use the PoP token with your Consumption logic app, follow the next section to [set up Azure AD OAuth](#enable-azure-ad-inbound).
811+
799812
<a name="enable-azure-ad-inbound"></a>
800813

801814
#### Enable Azure AD OAuth for your Consumption logic app resource
@@ -812,16 +825,21 @@ In the [Azure portal](https://portal.azure.com), add one or more authorization p
812825

813826
1. On the logic app menu, under **Settings**, select **Authorization**. After the Authorization pane opens, select **Add policy**.
814827

815-
![Select "Authorization" > "Add policy"](./media/logic-apps-securing-a-logic-app/add-azure-active-directory-authorization-policies.png)
828+
![Screenshot that shows Azure portal, Consumption logic app menu, Authorization page, and selected button to add policy.](./media/logic-apps-securing-a-logic-app/add-azure-active-directory-authorization-policies.png)
816829

817830
1. Provide information about the authorization policy by specifying the [claim types](../active-directory/develop/developer-glossary.md#claim) and values that your logic app expects in the access token presented by each inbound call to the Request trigger:
818831

819-
![Provide information for authorization policy](./media/logic-apps-securing-a-logic-app/set-up-authorization-policy.png)
832+
![Screenshot that shows Azure portal, Consumption logic app Authorization page, and information for authorization policy.](./media/logic-apps-securing-a-logic-app/set-up-authorization-policy.png)
820833

821834
| Property | Required | Type | Description |
822835
|----------|----------|------|-------------|
823836
| **Policy name** | Yes | String | The name that you want to use for the authorization policy |
824-
| **Claims** | Yes | String | The claim types and values that your workflow accepts from inbound calls. Here are the available claim types: <br><br>- **Issuer** <br>- **Audience** <br>- **Subject** <br>- **JWT ID** (JSON Web Token identifier) <br><br>Requirements: <br><br>- At a minimum, the **Claims** list must include the **Issuer** claim, which has a value that starts with `https://sts.windows.net/` or `https://login.microsoftonline.com/` as the Azure AD issuer ID. <br>- Each claim must be a single string value, not an array of values. For example, you can have a claim with **Role** as the type and **Developer** as the value. You can't have a claim that has **Role** as the type and the values set to **Developer** and **Program Manager**. <br>- The claim value is limited to a [maximum number of characters](logic-apps-limits-and-config.md#authentication-limits). <br><br>For more information about these claim types, review [Claims in Azure AD security tokens](../active-directory/develop/security-tokens.md#json-web-tokens-and-claims). You can also specify your own claim type and value. |
837+
| **Policy type** | Yes | String | Either **AAD** for bearer type tokens or **AADPOP** for Proof-of-Possession type tokens. |
838+
| **Claims** | Yes | String | A key-value pair that specifies the claim type and value that the workflow's Request trigger expects in the access token presented by each inbound call to the trigger. You can add any standard claim you want by selecting **Add standard claim**. To add a claim that's specific to a PoP token, select **Add custom claim**. <br><br>Available standard claim types: <br><br>- **Issuer** <br>- **Audience** <br>- **Subject** <br>- **JWT ID** (JSON Web Token identifier) <br><br>Requirements: <br><br>- At a minimum, the **Claims** list must include the **Issuer** claim, which has a value that starts with `https://sts.windows.net/` or `https://login.microsoftonline.com/` as the Azure AD issuer ID. <br><br>- Each claim must be a single string value, not an array of values. For example, you can have a claim with **Role** as the type and **Developer** as the value. You can't have a claim that has **Role** as the type and the values set to **Developer** and **Program Manager**. <br><br>- The claim value is limited to a [maximum number of characters](logic-apps-limits-and-config.md#authentication-limits). <br><br>For more information about these claim types, review [Claims in Azure AD security tokens](../active-directory/develop/security-tokens.md#json-web-tokens-and-claims). You can also specify your own claim type and value. |
839+
840+
The following example shows the information for a PoP token:
841+
842+
![Screenshot that shows Azure portal, Consumption logic app Authorization page, and information for a proof-of-possession policy.](./media/logic-apps-securing-a-logic-app/pop-policy-example.png)
825843

826844
1. To add another claim, select from these options:
827845

@@ -835,7 +853,7 @@ In the [Azure portal](https://portal.azure.com), add one or more authorization p
835853

836854
1. To include the `Authorization` header from the access token in the request-based trigger outputs, review [Include 'Authorization' header in request and HTTP webhook trigger outputs](#include-auth-header).
837855

838-
Workflow properties such as policies don't appear in your logic app's code view in the Azure portal. To access your policies programmatically, call the following API through Azure Resource Manager: `https://management.azure.com/subscriptions/{Azure-subscription-ID}/resourceGroups/{Azure-resource-group-name}/providers/Microsoft.Logic/workflows/{your-workflow-name}?api-version=2016-10-01&_=1612212851820`. Make sure that you replace the placeholder values for your Azure subscription ID, resource group name, and workflow name.
856+
Workflow properties such as policies don't appear in your workflow's code view in the Azure portal. To access your policies programmatically, call the following API through Azure Resource Manager: `https://management.azure.com/subscriptions/{Azure-subscription-ID}/resourceGroups/{Azure-resource-group-name}/providers/Microsoft.Logic/workflows/{your-workflow-name}?api-version=2016-10-01&_=1612212851820`. Make sure that you replace the placeholder values for your Azure subscription ID, resource group name, and workflow name.
839857

840858
<a name="define-authorization-policy-template"></a>
841859

8.25 KB
Loading
80.3 KB
Loading
10.5 KB
Loading

0 commit comments

Comments
 (0)