Decrypting an RPMSG Message file

Graf, Nico 0 Reputation points
2024-02-28T21:38:50.6833333+00:00

Hello, i have implemented the example to access an rpmsg-Message file (https://github.com/Azure-Samples/MipSDK-File-Dotnet-ServicePrincipalAuth). I have configured my MS Entra correctly, registeresd an app with application delegation access as it was described in the readme. But when i call "CreateFileHandlerAsync" i got an AccessDeniedException: The service didn't accept the auth token. Challenge:['Bearer resource="https://aadrm.com" ..... What can I do? What can be wrong configured? I have also booked an additional service (Enterprise Mobility + Security E3) to my Microsoft 365 Business Basic. Or must i have an other License? Regards Nico

Azure Information Protection
Azure Information Protection

An Azure service that is used to control and help secure email, documents, and sensitive data that are shared outside the company.

Microsoft 365 and Office | Install, redeem, activate | For business | Windows

1 answer

Sort by: Most helpful
  1. Alex Burlachenko 25,120 Reputation points MVP Volunteer Moderator
    2026-05-29T11:06:25.6933333+00:00

    hi Graf, Nico & thanks for join me here at Q&A portal,

    this error usually means the token returned to the MIP SDK is not valid for Azure Rights Management. The challenge says resource="https://aadrm.com", so when the SDK asks for a token for https://aadrm.com, ur auth delegate must return a token for exactly that resource/scope, not Graph, not ARM, not api.mip.microsoft.com. Look if the app registration permissions first. For MIP SDK service principal scenarios you need the right application permissions and admin consent. Microsoft documents the required MIP SDK permissions https://learn.microsoft.com/en-us/information-protection/develop/concept-api-permissions For protection/RPMSG work, make sure the app has Azure Rights Management permissions such as Content.DelegatedReader or the relevant RMS permission, and admin consent has actually been granted.

    Service principal auth does not magically mean the app can decrypt any RPMSG. The identity still must have rights to the protected message. If the message was protected for a specific user, the service principal must be acting in a supported delegated/super-user scenario, or the tenant must allow that service to access the protected content.

    U can review MIP SDK setup https://learn.microsoft.com/en-us/information-protection/develop/setup-configure-mip

    But review if token audience is https://aadrm.com, admin consent is granted for MIP/RMS application permissions, the service principal is actually authorized to decrypt that protected message....

    EMS E3 is generally enough for Azure Information Protection/Purview Information Protection features, but licensing alone will not fix a wrong token audience or missing RMS permission.

    rgds,

    Alex

    &

    If my answer was helpful pls mark it and additional thx if u follow me at Q&A portal
    

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.