Apologies for the delay in response.
Thanks for your detailed explanation, this is a great question and highlights a common integration challenge with the MIP SDK and Azure Information Protection (AIP) when moving toward managed identity and federated credentials.
What’s happening
The error Microsoft.InformationProtection.Exceptions.AccessDeniedException: The service didn't accept the auth token
indicates that the token obtained via the managed identity is not accepted by the Azure Rights Management (RMS/AIP) backend. This is expected behavior as of now because:
- The RMS service requires the exact appId of a registered Azure AD app that has been explicitly configured for MIP usage.
- Managed identities use workload identity federation, but AIP does not currently support federated tokens, it expects tokens obtained via client credentials using a certificate or client secret.
- RMS enforces a strict validation of the app ID, token audience, and associated permissions, and doesn't recognize the managed identity's appId.
What works today
For now, the officially supported and reliable way to authenticate with MIP SDK for decrypting AIP-protected content is:
- Use an Azure AD App Registration (not a managed identity).
- Authenticate using a client certificate or secret.
- Ensure your app is granted the correct API permissions, e.g.,
Azure Rights Management (Delegated User)
orContent.SuperUser
.
Workaround with managed identity
If your goal is to avoid storing certificates in code, you can still:
- Let your managed identity access Azure Key Vault to securely fetch the certificate.
- Use that certificate to authenticate as the AIP-registered app (not the managed identity itself).
- Use the resulting token with the MIP SDK.
This maintains cloud-native security hygiene while complying with RMS/AIP token validation requirements.
I hope this information helps. Please do let us know if you have any further queries.
Kindly consider upvoting the comment if the information provided is helpful. This can assist other community members in resolving similar issues.
Thank you.