WebAuthenticationCoreManager.FindSystemAccountProviderAsync WebAuthenticationCoreManager.FindSystemAccountProviderAsync WebAuthenticationCoreManager.FindSystemAccountProviderAsync WebAuthenticationCoreManager.FindSystemAccountProviderAsync WebAuthenticationCoreManager.FindSystemAccountProviderAsync Method

Definition

Overloads

FindSystemAccountProviderAsync(String) FindSystemAccountProviderAsync(String) FindSystemAccountProviderAsync(String) FindSystemAccountProviderAsync(String) FindSystemAccountProviderAsync(String)

Asynchronously attempts to find a web account provider for device-wide authentication.

FindSystemAccountProviderAsync(String, String) FindSystemAccountProviderAsync(String, String) FindSystemAccountProviderAsync(String, String) FindSystemAccountProviderAsync(String, String) FindSystemAccountProviderAsync(String, String)

Asynchronously attempts to find a web account provider for device-wide authentication.

FindSystemAccountProviderAsync(String, String, User) FindSystemAccountProviderAsync(String, String, User) FindSystemAccountProviderAsync(String, String, User) FindSystemAccountProviderAsync(String, String, User) FindSystemAccountProviderAsync(String, String, User)

Asynchronously attempts to find a web account provider for device-wide authentication.

FindSystemAccountProviderAsync(String) FindSystemAccountProviderAsync(String) FindSystemAccountProviderAsync(String) FindSystemAccountProviderAsync(String) FindSystemAccountProviderAsync(String)

Asynchronously attempts to find a web account provider for device-wide authentication.

public : static IAsyncOperation<WebAccountProvider> FindSystemAccountProviderAsync(Platform::String webAccountProviderId)
static IAsyncOperation<WebAccountProvider> FindSystemAccountProviderAsync(winrt::hstring webAccountProviderId) const;
public static IAsyncOperation<WebAccountProvider> FindSystemAccountProviderAsync(String webAccountProviderId)
Public Shared Function FindSystemAccountProviderAsync(webAccountProviderId As String) As IAsyncOperation(Of WebAccountProvider)
Windows.Security.Authentication.Web.Core.WebAuthenticationCoreManager.findSystemAccountProviderAsync(webAccountProviderId).done( /* Your success and error handlers */ );

Parameters

webAccountProviderId
String String String

The Id of the web account provider to find.

Returns

An asynchronous find operation. On successful completion, contains a WebAccountProvider object representing the found web account provider.

Additional features and requirements

Device family
Windows 10, version 1803 (introduced v10.0.17134.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v6)

FindSystemAccountProviderAsync(String, String) FindSystemAccountProviderAsync(String, String) FindSystemAccountProviderAsync(String, String) FindSystemAccountProviderAsync(String, String) FindSystemAccountProviderAsync(String, String)

Asynchronously attempts to find a web account provider for device-wide authentication.

public : static IAsyncOperation<WebAccountProvider> FindSystemAccountProviderAsync(Platform::String webAccountProviderId, Platform::String authority)
static IAsyncOperation<WebAccountProvider> FindSystemAccountProviderAsync(winrt::hstring webAccountProviderId, winrt::hstring authority) const;
public static IAsyncOperation<WebAccountProvider> FindSystemAccountProviderAsync(String webAccountProviderId, String authority)
Public Shared Function FindSystemAccountProviderAsync(webAccountProviderId As String, authority As String) As IAsyncOperation(Of WebAccountProvider)
Windows.Security.Authentication.Web.Core.WebAuthenticationCoreManager.findSystemAccountProviderAsync(webAccountProviderId, authority).done( /* Your success and error handlers */ );

Parameters

webAccountProviderId
String String String

The Id of the web account provider to find.

authority
String String String

The authority of the web account provider to find.

Returns

An asynchronous find operation. On successful completion, contains a WebAccountProvider object representing the found web account provider.

Additional features and requirements

Device family
Windows 10, version 1803 (introduced v10.0.17134.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v6)

Examples

The following is an example of this special case of device-wide token retrieval.

// create a WebTokenRequest with device-wide authentication
WebTokenRequest CreateWebTokenRequestForAad(WebAccountProvider provider){
    // check if the ID provider allows system-wide scope, and construct token request accordingly:
    return new WebTokenRequest(
        provider,
        provider.IsSystemProvider ? "systemInfo" : "userInfo",
        "<InsertClientID>");
    )
}

// retrieve a device-wide auth token for Azure Active Directory
string GetAadToken() {
    var provider = WebAuthenticationCoreManager.FindSystemAccountProviderAsync(
        "https://login.microsoft.com","organizations");
    var request = CreateWebTokenRequestForAad(provider);
    var result = WebAuthenticationCoreManager.GetTokenSilentlyAsync(request);

    // handle the request result in the usual way.
    if (result.ResponseStatus == WebTokenRequestStatus.Success){ 
        return result.ResponseData[0].Token; 
    } else { 
        throw new Exception(result.ResponseError.ErrorMessage); 
    }     
} 

Remarks

The device token feature is intended for cases in which a service needs to connect to cloud resources before a user ever signs into the device (for example, in out-of-box experiences where there are System Center Configuration Manager (SCCM) policies that must be applied right away). Only first-party ID providers (Xbox, MSA, AAD) allow device-wide tokens; other ID providers do not.

See also
P:Windows.Security.Credentials.WebAccountProvider.IsSystemProvider**

FindSystemAccountProviderAsync(String, String, User) FindSystemAccountProviderAsync(String, String, User) FindSystemAccountProviderAsync(String, String, User) FindSystemAccountProviderAsync(String, String, User) FindSystemAccountProviderAsync(String, String, User)

Asynchronously attempts to find a web account provider for device-wide authentication.

public : static IAsyncOperation<WebAccountProvider> FindSystemAccountProviderAsync(Platform::String webAccountProviderId, Platform::String authority, User user)
static IAsyncOperation<WebAccountProvider> FindSystemAccountProviderAsync(winrt::hstring webAccountProviderId, winrt::hstring authority, User user) const;
public static IAsyncOperation<WebAccountProvider> FindSystemAccountProviderAsync(String webAccountProviderId, String authority, User user)
Public Shared Function FindSystemAccountProviderAsync(webAccountProviderId As String, authority As String, user As User) As IAsyncOperation(Of WebAccountProvider)
Windows.Security.Authentication.Web.Core.WebAuthenticationCoreManager.findSystemAccountProviderAsync(webAccountProviderId, authority, user).done( /* Your success and error handlers */ );

Parameters

webAccountProviderId
String String String

The Id of the web account provider to find.

authority
String String String

The authority of the web account provider to find.

user
User User User

The user associated with the web account provider to find.

Returns

An asynchronous find operation. On successful completion, contains a WebAccountProvider object representing the found web account provider.

Additional features and requirements

Device family
Windows 10, version 1803 (introduced v10.0.17134.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v6)