Skip to content

Commit d5a6a4d

Browse files
Merge pull request #241644 from omondiatieno/saml-token-encryption
Added Microsoft Graph PowerShell examples and removed unnecessary steps.
2 parents 1186c1f + 9cd82b3 commit d5a6a4d

File tree

1 file changed

+29
-8
lines changed

1 file changed

+29
-8
lines changed

articles/active-directory/manage-apps/howto-saml-token-encryption.md

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.service: active-directory
88
ms.subservice: app-mgmt
99
ms.workload: identity
1010
ms.topic: conceptual
11-
ms.date: 07/21/2022
11+
ms.date: 06/15/2023
1212
ms.author: jomondi
1313
ms.reviewer: alamaral
1414
ms.collection: M365-identity-device-management
@@ -42,8 +42,8 @@ To configure enterprise application's SAML token encryption, follow these steps:
4242

4343
Create an asymmetric key pair to use for encryption. Or, if the application supplies a public key to use for encryption, follow the application's instructions to download the X.509 certificate.
4444

45-
The public key should be stored in an X.509 certificate file in .cer format.
46-
45+
The public key should be stored in an X.509 certificate file in .cer format. You can copy the contents of the certificate file to a text editor and save it as a .cer file. The certificate file should contain only the public key and not the private key.
46+
4747
If the application uses a key that you create for your instance, follow the instructions provided by your application for installing the private key that the application will use to decrypt tokens from your Azure AD tenant.
4848

4949
1. Add the certificate to the application configuration in Azure AD.
@@ -54,7 +54,9 @@ You can add the public cert to your application configuration within the Azure p
5454

5555
1. Go to the [Azure portal](https://portal.azure.com).
5656

57-
1. Go to the **Azure Active Directory > Enterprise applications** blade and then select the application that you wish to configure token encryption for.
57+
1. Search for and select the **Azure Active Directory**.
58+
59+
1. Select **Enterprise applications** blade and then select the application that you wish to configure token encryption for.
5860

5961
1. On the application's page, select **Token encryption**.
6062

@@ -101,8 +103,6 @@ To configure token encryption, follow these steps:
101103

102104
1. In the application's page, select **Manifest** to edit the [application manifest](../develop/reference-app-manifest.md).
103105

104-
1. Set the value for the `tokenEncryptionKeyId` attribute.
105-
106106
The following example shows an application manifest configured with two encryption certificates, and with the second selected as the active one using the tokenEncryptionKeyId.
107107

108108
```json
@@ -172,7 +172,7 @@ To configure token encryption, follow these steps:
172172
}
173173
```
174174

175-
# [PowerShell](#tab/azure-powershell)
175+
# [Azure AD PowerShell](#tab/azuread-powershell)
176176

177177
1. Use the latest Azure AD PowerShell module to connect to your tenant.
178178

@@ -190,7 +190,29 @@ To configure token encryption, follow these steps:
190190
$app.TokenEncryptionKeyId
191191
```
192192

193+
# [Microsoft Graph PowerShell](#tab/msgraph-powershell)
193194

195+
1. Use the Microsoft Graph PowerShell module to connect to your tenant.
196+
197+
1. Set the token encryption settings using the **[Update-MgApplication](/powershell/module/microsoft.graph.applications/update-mgapplication?view=graph-powershell-1.0&preserve-view=true)** command.
198+
199+
```powershell
200+
201+
Update-MgApplication -ApplicationId <ApplicationObjectId> -KeyCredentials "<KeyCredentialsObject>" -TokenEncryptionKeyId <keyID>
202+
203+
```
204+
205+
1. Read the token encryption settings using the following commands.
206+
207+
```powershell
208+
209+
$app=Get-MgApplication -ApplicationId <ApplicationObjectId>
210+
211+
$app.KeyCredentials
212+
213+
$app.TokenEncryptionKeyId
214+
215+
```
194216
# [Microsoft Graph](#tab/microsoft-graph)
195217

196218
1. Update the application's `keyCredentials` with an X.509 certificate for encryption. The following example shows a Microsoft Graph JSON payload with a collection of key credentials associated with the application.
@@ -221,7 +243,6 @@ To configure token encryption, follow these steps:
221243

222244
---
223245

224-
225246
## Next steps
226247

227248
* Find out [How Azure AD uses the SAML protocol](../develop/active-directory-saml-protocol-reference.md)

0 commit comments

Comments
 (0)