إشعار
يتطلب الوصول إلى هذه الصفحة تخويلاً. يمكنك محاولة تسجيل الدخول أو تغيير الدلائل.
يتطلب الوصول إلى هذه الصفحة تخويلاً. يمكنك محاولة تغيير الدلائل.
To authenticate in the MIP SDK, extend the mip::AuthDelegate class to implement your preferred authentication method. mip::AuthDelegate contains:
mip::AuthDelegate::OAuth2Challenge- a class that manages OAuth 2.0 authority information and provides it to the client application.mip::AuthDelegate::OAuth2Token- a class that manages OAuth 2.0 access token acquisition from the client application and token storage.mip::AuthDelegate::AcquireOAuth2Token()- a pure virtual function whose implementation determines the access token acquisition method. After the SDK calls it, the implementation acquires the access token and provides it back to the SDK's authentication logic.
mip::AuthDelegate::AcquireOAuth2Token accepts the following parameters and returns a bool indicating whether token acquisition succeeded:
mip::Identity: The identity of the user or service for authentication, if known.mip::AuthDelegate::OAuth2Challenge: Accepts four parameters: authority, resource, claims, and scopes. Authority is the service that generates the token. Resource is the service the application tries to access. The SDK passes these parameters into the delegate when called. Claims are the label-specific claims required by the protection service. Scopes are the Microsoft Entra permission scopes required to access the resource.mip::AuthDelegate::OAuth2Token: The SDK writes the token result to this object. The SDK consumes it when the engine loads. Outside of your authentication implementation, you don't need to get or set this value anywhere.
Important
Applications don't call AcquireOAuth2Token directly. The SDK calls this function when required.
Next steps
For simplicity, samples that demonstrate the delegate implement token acquisition by calling an external script. You can replace this script with another script, an open-source OAuth 2.0 library, or a custom OAuth 2.0 library.