OnlineIdServiceTicketRequest OnlineIdServiceTicketRequest OnlineIdServiceTicketRequest OnlineIdServiceTicketRequest OnlineIdServiceTicketRequest Class

Definition

Provides the ability for an app to specify the service and policy that is used to authenticate a Live user to obtain identity properties and tickets.

Note

If you are developing for Windows 10 or greater, use the Windows.Security.Authentication.Web.Core APIs instead. For more information, see Web account manager.

public : sealed class OnlineIdServiceTicketRequest
struct winrt::Windows::Security::Authentication::OnlineId::OnlineIdServiceTicketRequest
public sealed class OnlineIdServiceTicketRequest
Public NotInheritable Class OnlineIdServiceTicketRequest
var onlineIdServiceTicketRequest = new onlineIdServiceTicketRequest(service);
Attributes

Windows 10 requirements

Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Examples

The following example shows how to specify the service and policy that is used to authenticate a Live user.

function signIn() {
    var authenticator = new Windows.Security.Authentication.OnlineId.OnlineIdAuthenticator();
    var serviceTicketRequest = new Windows.Security.Authentication.OnlineId.OnlineIdServiceTicketRequest(
        "wl.basic wl.contacts_photos wl.calendars", "DELEGATION");

    sdkSample.displayStatus("Signing in...");

    authenticator.authenticateUserAsync(serviceTicketRequest)
        .done(function (authResult) {

            if ((authResult.tickets.size == 1) && (authResult.tickets[0].errorCode == 0)) {
                sdkSample.isSignedIn = true;
                sdkSample.displayStatus("Authorization succeeded.");
                sdkSample.accessToken = authResult.tickets[0];
                sdkSample.canSignOut = authenticator.canSignOut;
            }
        },

            function (authStatus) {
                if (authStatus && (authStatus.name !== "Canceled")) {
                    showErrorMessage("Autorization failed: " + authStatus.message);
                } else {
                    sdkSample.displayStatus("");
                }
                    showAccountStatus();
                });
}

Constructors

OnlineIdServiceTicketRequest(String) OnlineIdServiceTicketRequest(String) OnlineIdServiceTicketRequest(String) OnlineIdServiceTicketRequest(String) OnlineIdServiceTicketRequest(String)

Creates an instance of the OnlineIdServiceTicketRequest class.

Note

If you are developing for Windows 10 or greater, use the Windows.Security.Authentication.Web.Core APIs instead. For more information, see Web account manager.

OnlineIdServiceTicketRequest(String, String) OnlineIdServiceTicketRequest(String, String) OnlineIdServiceTicketRequest(String, String) OnlineIdServiceTicketRequest(String, String) OnlineIdServiceTicketRequest(String, String)

Creates an instance of the OnlineIdServiceTicketRequest class.

Note

If you are developing for Windows 10 or greater, use the Windows.Security.Authentication.Web.Core APIs instead. For more information, see Web account manager.

Properties

Policy Policy Policy Policy Policy

The policy used to authenticate users. Supported values are JWT, which returns data using the JSON format. For apps that are requesting user consent to access stored in Live, app developer must pass a policy of DELEGATION.

Note

If you are developing for Windows 10 or greater, use the Windows.Security.Authentication.Web.Core APIs instead. For more information, see Web account manager.

Service Service Service Service Service

Identifies the service your app uses. The service name must match the DNS name you supplied when registering your app on http://go.microsoft.com/fwlink/p/?linkid=241860. Tickets are issued only for this service. For apps that are requesting user consent to access stored in Live, you must pass the offers to which your app needs access. The available list of offers can be found at our Scopes and Permissions page. The ticket can then be used with the Live Connect REST apis to access data that a user has consented to give to the app. Check out our REST APIs topic to learn more. Alternatively, the app can use the Live Connect SDK which will make these calls itself.

Note

If you are developing for Windows 10 or greater, use the Windows.Security.Authentication.Web.Core APIs instead. For more information, see Web account manager.