I am new to Sitecore Azure AD authentication setup. So I had followed the link (https://www.velir.com/blog/2019/07/01/integrating-identity-server-azure-active-directory-single-sign-sso-sitecore-91) to set up Azure AD owin authentication in Sitecore. Everything is working fine now.
Since I am following the persistent user creation process, now the client is asking to create only specific Azure AD security group members, if they do not exist in Sitecore back office. Currently, we are creating all the users who are present in Azure AD.
So could anyone help me how to restrict the user creation only based on a certain Azure AD group?
Below is my claims transformation configured in AzureAd.xml
<ClaimsTransformations>
<!--Place transformation rules here. -->
<ClaimsTransformation1 type="Sitecore.Plugin.IdentityProviders.DefaultClaimsTransformation, Sitecore.Plugin.IdentityProviders">
<SourceClaims>
<Claim1 type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn" />
</SourceClaims>
<NewClaims>
<Claim1 type="email" />
</NewClaims>
</ClaimsTransformation1 >
<ClaimsTransformation2 type="Sitecore.Plugin.IdentityProviders.DefaultClaimsTransformation, Sitecore.Plugin.IdentityProviders">
<SourceClaims>
<Claim1 type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name" />
</SourceClaims>
<NewClaims>
<Claim1 type="name" />
</NewClaims>
</ClaimsTransformation2>
<AzureADUserToAdminUser1 type="Sitecore.Plugin.IdentityProviders.DefaultClaimsTransformation, Sitecore.Plugin.IdentityProviders">
<SourceClaims>
<Claim1 type="groups" value="420bttyc-8c0d-4c3e-a8df-30a4cea08f68" />
</SourceClaims>
<NewClaims>
<Claim1 type="role" value="sitecore\Sitecore Client Users" />
</NewClaims>
</AzureADUserToAdminUser1>
</ClaimsTransformations>
Also Using CustomExternalUserBuilder for Unique username creation.
ClaimsTransformations
within theSitecore.Plugin.IdentityProvider.AzureAd.xml' config file ? Are you using the default
DefaultExternalUserBuilder ` or a custom one. To meet you requirements, you will need to add custom logic in your implementation of ExternalUserBuilder. You may consider reviewing my blog too 360agileweb.wordpress.com/2020/02/28/sitecore-host-part-three for extra pointers