Configure Azure AD as an OIDC provider with a Custom Mapping policy

Configure Azure AD as an OIDC provider with a Custom Mapping policy

95
Created On 11/10/26 11:03 AM - Last Modified 11/10/26 16:05 PM


Objective


Azure AD does not have a mapping policy by default that allows sending the onPremisesSamAccountName property as a response to an OIDC request. The default claim users User Principal Name, so if users need to log in using their samAccountname to Idira a custom claims mapping will need to be configured.

This article will discuss how to both configure Azure AD as an OIDC provider for Idira in the Azure configuration and on the PVWA, including how to setup a custom mappings policy.



Environment


12.2;12.4;12.3;12.5;12.6;14.6 Privileged Access Manager (PAM, self-hosted) Password Vault Web Access

Procedure


I. Configure the application in Azure AD:

1 : Login to the Azure portal and navigate to App registrations.
image.png

2: Select New registration.
image.png

3 : Enter a display name. For example, CyberArk
image.png

4: Configure the Application
a. Click on the Authentication Tab & Add the Redirect URL
image.png

5 :
a. Click on API Permissions & Add the API permission
b. Grant admin consent
image.png
c. If users log into PVWA with their samAccountname, a custom Claims Mapping policy must be created and linked to a specific service principal. An example map to use onPremisesSamAccountName can be found below.  Microsoft documents this process at https://learn.microsoft.com/en-us/azure/active-directory/develop/active-directory-claims-mapping
 

onPremisesSamAccountName example commands for step c:

The Microsoft document above explains how to create a custom mapping policy and link it via commands. The command below is a Powershell command to create a custom mapping for onPremisesSamAccountName:
 

New-AzureADPolicy -Definition @('{
"ClaimsMappingPolicy":{
"Version":1,
"IncludeBasicClaimSet":"true",
"ClaimsSchema": [{
"Source":"user",
"ID":"onPremisesSamAccountName",
"SamlClaimType":http://schemas.xmlsoap.org/ws/2005/05/identity/claims/employeeid,
"JwtClaimType":"SamAccountName’"},{
"Source":"company",
"ID":"tenantcountry",
"SamlClaimType":http://schemas.xmlsoap.org/ws/2005/05/identity/claims/country,
"JwtClaimType":"country"}]}}') -DisplayName "ExtraClaimsExample" -Type "ClaimsMappingPolicy"

Once the policy is created, it needs to be assigned to the application. Again, this is referenced in Microsoft documentation in step c above. The command to do this in Powershell is:

Add-AzureADServicePrincipalPolicy -Id <ObjectId of the ServicePrincipal> -RefObjectId <ObjectId of the Policy>
 

II. Configure AzureAD as an OIDC provider in the PVWA

Follow the CyberArk documentation for configuring the OIDC provider in PVWA. The direct link is: https://docs.cyberark.com/Product-Doc/OnlineHelp/PAS/12.6/en/Content/PAS%20INST/OIDC-Authentication.htm#ConfigureanOIDCIdentityProviderinPVWA
 

III. Test logging in with OIDC



Actions
  • Print
  • Copy Link

    https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA1hj0000001KKyCAM&lang=en_US&refURL=http%3A%2F%2Fknowledgebase.paloaltonetworks.com%2FKCSArticleDetail