共用方式為


UserPolicy.AcquireAsync method

Acquire a policy.

Syntax

public:
static IAsyncOperation<GetUserPolicyResult>^ AcquireAsync(
  IBuffer^ serializedPolicy, 
  String^ userId, 
  IAuthenticationCallback^ authenticationCallback, 
  IConsentCallback^ consentCallback, 
  PolicyAcquisitionOptions options
)

Parameters

serializedPolicy

Type: IBuffer

the PL to be consumed

userId

Type: String

The email address of the user that is trying to consume the protected content.

This email address will be used to determine which policy object to use from the offline cache.

If a policy object for this user is not found in the offline cache then this API will go online (if allowed) to get the policy object.

If null is passed, the first policy object found in the offline cache will be used. And again if there is no policy object found for this content in the offline cache, this API will go online to get the policy object.

This parameter is also used as a hint for userId for user authentication, i.e., it will be passed to the IAuthenticationCallback.GetTokenAsync() in the AuthenticationParameters structure.

authenticationCallback

Type: IAuthenticationCallback

Authentication callback to be used for authentication process.

consentCallback

Type: IConsentCallback

Consent callback user for user consent process

options

Type: PolicyAcquisitionOptions

offline flag

Return value

Type: GetUserPolicyResult

The asynchronous operation. Upon completion, IAsyncOperation.GetResults returns a GetUserPolicyResult object.

Requirements

Minimum supported client
None supported
Minimum supported server
None supported
Minimum supported phone
Windows Phone 8.1
Namespace
Microsoft::RightsManagement
Metadata
Microsoft.RightsManagement.winmd

See also

UserPolicy