Share via


WebAccountProviderRequestTokenOperation Class

Definition

Represents a request token operation.

public ref class WebAccountProviderRequestTokenOperation sealed : IWebAccountProviderTokenOperation, IWebAccountProviderUIReportOperation
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class WebAccountProviderRequestTokenOperation final : IWebAccountProviderTokenOperation, IWebAccountProviderUIReportOperation
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class WebAccountProviderRequestTokenOperation : IWebAccountProviderTokenOperation, IWebAccountProviderUIReportOperation
Public NotInheritable Class WebAccountProviderRequestTokenOperation
Implements IWebAccountProviderTokenOperation, IWebAccountProviderUIReportOperation
Inheritance
Object Platform::Object IInspectable WebAccountProviderRequestTokenOperation
Attributes
Implements

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Examples

The following demonstrates an example of how to handle a request token operation:

WebAccountProviderRequestTokenOperation webAccountProviderRequestTokenOperation;
string accessToken;

protected override void OnNavigatedTo(NavigationEventArgs e)
{
    this.webAccountProviderRequestTokenOperation = 
        (WebAccountProviderRequestTokenOperation)e.Parameter;
    base.OnNavigatedTo(e);
}

private void Authentication_Click(object sender, RoutedEventArgs e)
{
    Uri uri;
    if (webAccountProviderRequestTokenOperation != null)
    {
        // Build the URI using information about the web account from the request
        uri = new Uri("INSERT URI HERE"); 
    }
    else
    {
        // Build the Uri using user-entered information
        uri = new Uri("INSERT URI HERE"); 
    }
    // Complete authentication using the built Uri
    WebTokenResponse response = new WebTokenResponse(this.accessToken);
    WebProviderTokenResponse providerResponse = 
        new WebProviderTokenResponse(response, DateTimeOffset.Now.AddHours(1));
    webAccountProviderRequestTokenOperation.ProviderResponses.Add(providerResponse);
    // Return the result
    WebAccountManager.SendTokenResultCompleted(webAccountProviderOperation);
}    

Properties

CacheExpirationTime

Gets or sets the cache expiration time.

Kind

Gets the kind of web account provider operation.

ProviderRequest

Gets the web provider token request.

ProviderResponses

Gets the web provider token responses.

Methods

ReportCompleted()

Informs the activating app that the operation completed successfully.

ReportError(WebProviderError)

Informs the activating app that the operation encountered an error.

ReportUserCanceled()

Informs the activating app that the user cancelled the operation.

Applies to

See also