SAML token encryption - Microsoft Entra ID (2024)

  • Article

Note

Token encryption is a Microsoft Entra ID P1 or P2 feature. To learn more about Microsoft Entra editions, features, and pricing, see Microsoft Entra pricing.

SAML token encryption enables the use of encrypted SAML assertions with an application that supports it. When configured for an application, Microsoft Entra ID will encrypt the SAML assertions it emits for that application using the public key obtained from a certificate stored in Microsoft Entra ID. The application must use the matching private key to decrypt the token before it can be used as evidence of authentication for the signed in user.

Encrypting the SAML assertions between Microsoft Entra ID and the application provides additional assurance that the content of the token can't be intercepted, and personal or corporate data compromised.

Even without token encryption, Microsoft Entra SAML tokens are never passed on the network in the clear. Microsoft Entra ID requires token request/response exchanges to take place over encrypted HTTPS/TLS channels so that communications between the IDP, browser, and application take place over encrypted links. Consider the value of token encryption for your situation compared with the overhead of managing more certificates.

To configure token encryption, you need to upload an X.509 certificate file that contains the public key to the Microsoft Entra application object that represents the application. To obtain the X.509 certificate, you can download it from the application itself, or get it from the application vendor in cases where the application vendor provides encryption keys or in cases where the application expects you to provide a private key, it can be created using cryptography tools, the private key portion uploaded to the application’s key store and the matching public key certificate uploaded to Microsoft Entra ID.

Microsoft Entra ID uses AES-256 to encrypt the SAML assertion data.

Prerequisites

To configure SAML token encryption, you need:

  • A Microsoft Entra user account. If you don't already have one, you can Create an account for free.
  • One of the following roles: Global Administrator, Cloud Application Administrator, Application Administrator, or owner of the service principal.

Configure enterprise application SAML token encryption

This section describes how to configure enterprise application's SAML token encryption. Applications that have been set up from the Enterprise applications blade in the Microsoft Entra admin center, either from the Application Gallery or a Non-Gallery app. For applications registered through the App registrations experience, follow the Configure registered application SAML token encryption guidance.

To configure enterprise application's SAML token encryption, follow these steps:

  1. Obtain a public key certificate that matches a private key that's configured in the application.

    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.

    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.

    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 Microsoft Entra tenant.

  2. Add the certificate to the application configuration in Microsoft Entra ID.

Configure token encryption in the Microsoft Entra admin center

You can add the public cert to your application configuration within the Microsoft Entra admin center.

  1. Sign in to the Microsoft Entra admin center as at least a Cloud Application Administrator.

  2. Browse to Identity > Applications > Enterprise applications > All applications.

  3. Enter the name of the existing application in the search box, and then select the application from the search results.

  4. On the application's page, select Token encryption.

    SAML token encryption - Microsoft Entra ID (1)

    Note

    The Token encryption option is only available for SAML applications that have been set up from the Enterprise applications blade in the Microsoft Entra admin center, either from the Application Gallery or a Non-Gallery app. For other applications, this menu option is disabled.

  5. On the Token encryption page, select Import Certificate to import the .cer file that contains your public X.509 certificate.

    SAML token encryption - Microsoft Entra ID (2)

  6. Once the certificate is imported, and the private key is configured for use on the application side, activate encryption by selecting the ... next to the thumbprint status, and then select Activate token encryption from the options in the dropdown menu.

  7. Select Yes to confirm activation of the token encryption certificate.

  8. Confirm that the SAML assertions emitted for the application are encrypted.

To deactivate token encryption in the Microsoft Entra admin center

  1. In the Microsoft Entra admin center, go to Identity > Applications > Enterprise applications > All applications, and then select the application that has SAML token encryption enabled.

  2. On the application's page, select Token encryption, find the certificate, and then select the ... option to show the dropdown menu.

  3. Select Deactivate token encryption.

Configure registered application SAML token encryption

This section describes how to configure registered application's SAML token encryption. Applications that have been set up from the App registrations blade in the Microsoft Entra admin center. For enterprise application, follow the Configure enterprise application SAML token encryption guidance.

Encryption certificates are stored on the application object in Microsoft Entra ID with an encrypt usage tag. You can configure multiple encryption certificates and the one that's active for encrypting tokens is identified by the tokenEncryptionKeyID attribute.

You'll need the application's object ID to configure token encryption using Microsoft Graph API or PowerShell. You can find this value programmatically, or by going to the application's Properties page in the Microsoft Entra admin center and noting the Object ID value.

When you configure a keyCredential using Graph, PowerShell, or in the application manifest, you should generate a GUID to use for the keyId.

To configure token encryption for an application registration, follow these steps:

  • Portal
  • Azure AD PowerShell
  • Microsoft Graph PowerShell
  • Microsoft Graph
  1. Sign in to the Microsoft Entra admin center as at least a Cloud Application Administrator.

  2. Browse to Identity > Applications > App registrations > All applications.

  3. Enter the name of the existing application in the search box, and then select the application from the search results.

  4. In the application's page, select Manifest to edit the application manifest.

    The following example shows an application manifest configured with two encryption certificates, and with the second selected as the active one using the tokenEncryptionKeyId.

    { "id": "3cca40e2-367e-45a5-8440-ed94edd6cc35", "accessTokenAcceptedVersion": null, "allowPublicClient": false, "appId": "cb2df8fb-63c4-4c35-bba5-3d659dd81bf1", "appRoles": [], "oauth2AllowUrlPathMatching": false, "createdDateTime": "2017-12-15T02:10:56Z", "groupMembershipClaims": "SecurityGroup", "informationalUrls": { "termsOfService": null, "support": null, "privacy": null, "marketing": null }, "identifierUris": [ "https://testapp" ], "keyCredentials": [ { "customKeyIdentifier": "Tog/O1Hv1LtdsbPU5nPphbMduD=", "endDate": "2039-12-31T23:59:59Z", "keyId": "8be4cb65-59d9-404a-a6f5-3d3fb4030351", "startDate": "2018-10-25T21:42:18Z", "type": "AsymmetricX509Cert", "usage": "Encrypt", "value": <Base64EncodedKeyFile> "displayName": "CN=SAMLEncryptTest" }, { "customKeyIdentifier": "U5nPphbMduDmr3c9Q3p0msqp6eEI=", "endDate": "2039-12-31T23:59:59Z", "keyId": "6b9c6e80-d251-43f3-9910-9f1f0be2e851", "startDate": "2018-10-25T21:42:18Z", "type": "AsymmetricX509Cert", "usage": "Encrypt", "value": <Base64EncodedKeyFile> "displayName": "CN=SAMLEncryptTest2" } ], "knownClientApplications": [], "logoUrl": null, "logoutUrl": null, "name": "Test SAML Application", "oauth2AllowIdTokenImplicitFlow": true, "oauth2AllowImplicitFlow": false, "oauth2Permissions": [], "oauth2RequirePostResponse": false, "orgRestrictions": [], "parentalControlSettings": { "countriesBlockedForMinors": [], "legalAgeGroupRule": "Allow" }, "passwordCredentials": [], "preAuthorizedApplications": [], "publisherDomain": null, "replyUrlsWithType": [], "requiredResourceAccess": [], "samlMetadataUrl": null, "signInUrl": "https://127.0.0.1:444/applications/default.aspx?metadata=customappsso|ISV9.1|primary|z" "signInAudience": "AzureADMyOrg", "tags": [], "tokenEncryptionKeyId": "6b9c6e80-d251-43f3-9910-9f1f0be2e851" } 

Next steps

  • Find out How Microsoft Entra ID uses the SAML protocol
  • Learn the format, security characteristics, and contents of SAML tokens in Microsoft Entra ID
SAML token encryption - Microsoft Entra ID (2024)
Top Articles
HACCP Prerequisites
3 Different Kinds of Business Processes That Deliver and Support Customer Value — Helping Companies Deliver More Value Through Better Process Management | Bob Stanke
Skigebiet Portillo - Skiurlaub - Skifahren - Testberichte
Victory Road Radical Red
Urist Mcenforcer
Blackstone Launchpad Ucf
Southside Grill Schuylkill Haven Pa
Get train & bus departures - Android
1movierulzhd.fun Reviews | scam, legit or safe check | Scamadviser
San Diego Terminal 2 Parking Promo Code
Craigslist Cars And Trucks Buffalo Ny
Call of Duty: NEXT Event Intel, How to Watch, and Tune In Rewards
Nieuwe en jong gebruikte campers
Tight Tiny Teen Scouts 5
Nashville Predators Wiki
Wilmot Science Training Program for Deaf High School Students Expands Across the U.S.
Mals Crazy Crab
Nhl Tankathon Mock Draft
Teacup Yorkie For Sale Up To $400 In South Carolina
Craigslist Pearl Ms
Xfinity Cup Race Today
How to Make Ghee - How We Flourish
Bn9 Weather Radar
Student Portal Stvt
Wonder Film Wiki
Bolly2Tolly Maari 2
Prévisions météo Paris à 15 jours - 1er site météo pour l'île-de-France
DIY Building Plans for a Picnic Table
Dtlr On 87Th Cottage Grove
Gyeon Jahee
Selfservice Bright Lending
The Legacy 3: The Tree of Might – Walkthrough
Santa Cruz California Craigslist
Bimmerpost version for Porsche forum?
Buhsd Studentvue
The Vélodrome d'Hiver (Vél d'Hiv) Roundup
Duff Tuff
Poe Flameblast
Cbs Fantasy Mlb
1v1.LOL Game [Unblocked] | Play Online
877-292-0545
2 Pm Cdt
Sas Majors
Busted Newspaper Mcpherson Kansas
Deepwoken: How To Unlock All Fighting Styles Guide - Item Level Gaming
Shell Gas Stations Prices
Peace Sign Drawing Reference
Cvs Coit And Alpha
Dayton Overdrive
Mikayla Campinos Alive Or Dead
Nkey rollover - Hitta bästa priset på Prisjakt
One Facing Life Maybe Crossword
Latest Posts
Article information

Author: Rubie Ullrich

Last Updated:

Views: 6331

Rating: 4.1 / 5 (52 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Rubie Ullrich

Birthday: 1998-02-02

Address: 743 Stoltenberg Center, Genovevaville, NJ 59925-3119

Phone: +2202978377583

Job: Administration Engineer

Hobby: Surfing, Sailing, Listening to music, Web surfing, Kitesurfing, Geocaching, Backpacking

Introduction: My name is Rubie Ullrich, I am a enthusiastic, perfect, tender, vivacious, talented, famous, delightful person who loves writing and wants to share my knowledge and understanding with you.