OnlineIdServiceTicketRequest OnlineIdServiceTicketRequest OnlineIdServiceTicketRequest OnlineIdServiceTicketRequest Class

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.

Syntax

Declaration

public sealed class OnlineIdServiceTicketRequestpublic sealed class OnlineIdServiceTicketRequestPublic NotInheritable Class OnlineIdServiceTicketRequest

Remarks

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 summary

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.

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 summary

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.

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.

Constructors

  • OnlineIdServiceTicketRequest(System.String)
    OnlineIdServiceTicketRequest(System.String)
    OnlineIdServiceTicketRequest(System.String)
    OnlineIdServiceTicketRequest(System.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(System.String)public OnlineIdServiceTicketRequest(System.String)Public Function OnlineIdServiceTicketRequest(System.String) As

    Parameters

    • service
      System.String
      System.String
      System.String
      System.String

      The service for the request.

  • OnlineIdServiceTicketRequest(System.String,System.String)
    OnlineIdServiceTicketRequest(System.String,System.String)
    OnlineIdServiceTicketRequest(System.String,System.String)
    OnlineIdServiceTicketRequest(System.String,System.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(System.String,System.String)public OnlineIdServiceTicketRequest(System.String,System.String)Public Function OnlineIdServiceTicketRequest(System.String,System.String) As

    Parameters

    • service
      System.String
      System.String
      System.String
      System.String

      The service for the request.

    • policy
      System.String
      System.String
      System.String
      System.String

      The policy for the request.

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 string Policy { get; }public string Policy { get; }Public ReadOnly Property Policy As string

    Property Value

    • 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 string Service { get; }public string Service { get; }Public ReadOnly Property Service As string

    Property Value

    • string
      string
      string
      string

      A string that represents the service.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ThreadingAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.ActivatableAttribute
Windows.Foundation.Metadata.ContractVersionAttribute

Details

Assembly

Windows.Security.Authentication.OnlineId.dll