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 : IOnlineIdServiceTicketRequestpublic sealed class OnlineIdServiceTicketRequest : IOnlineIdServiceTicketRequestPublic NotInheritable Class OnlineIdServiceTicketRequest Implements IOnlineIdServiceTicketRequest// You can use this class in JavaScript.
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)

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.

public : OnlineIdServiceTicketRequest(PlatForm::String service)public OnlineIdServiceTicketRequest(String service)Public Sub New(service As String)// You can use this method in JavaScript.
Parameters
service
PlatForm::String String String String

The service for the request.

See Also

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.

public : OnlineIdServiceTicketRequest(PlatForm::String service, PlatForm::String policy)public OnlineIdServiceTicketRequest(String service, String policy)Public Sub New(service As String, policy As String)// You can use this method in JavaScript.
Parameters
service
PlatForm::String String String String

The service for the request.

policy
PlatForm::String String String String

The policy for the request.

See Also

Properties

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.

public : PlatForm::String Policy { get; }public string Policy { get; }Public ReadOnly Property Policy As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

A string that represents the policy.

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.

public : PlatForm::String Service { get; }public string Service { get; }Public ReadOnly Property Service As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

A string that represents the service.