Acquire an access token (sample-based)

MIP SDK C++ applications still implement mip::AuthDelegate, but token acquisition is documented through the official sample.

Use the sample repository as the source of truth for the token provider implementation:

The sample demonstrates an MSAL.NET-based token acquisition helper that the C++ auth delegate calls at runtime.

What to implement in your C++ project

Your C++ app should:

  1. Implement mip::AuthDelegate::AcquireOAuth2Token(...).
  2. Read the resource, authority, and claims from the OAuth2Challenge parameter.
  3. Pass the username or login hint, client ID, resource, authority, and claims to the sample's AcquireToken helper, in that order. The helper converts the resource to the scopes required by MSAL.
  4. Set the returned access token on OAuth2Token.

Quickstart integration guidance

The C++ quickstarts intentionally do not provide an end-to-end OAuth implementation. For authentication setup:

  1. Follow Quickstart: Client application initialization (C++).
  2. Reuse the authentication implementation pattern from MipSDK-File-Cpp-Basic.
  3. Return to the quickstarts after confirming token acquisition works for your tenant and app registration.

This approach keeps the quickstarts focused on MIP SDK object usage while allowing auth implementation details to evolve in the sample.