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.
Syntax
var onlineIdServiceTicketRequest = new Windows.Security.Authentication.OnlineId.OnlineIdServiceTicketRequest(string, string); var onlineIdServiceTicketRequest = new Windows.Security.Authentication.OnlineId.OnlineIdServiceTicketRequest(string);
Attributes
- ActivatableAttribute(Windows.Security.Authentication.OnlineId.IOnlineIdServiceTicketRequestFactory, NTDDI_WIN8)
- MarshalingBehaviorAttribute(Agile)
- ThreadingAttribute(Both)
- VersionAttribute(NTDDI_WIN8)
Members
The OnlineIdServiceTicketRequest class has these types of members:
Constructors
The OnlineIdServiceTicketRequest class has these constructors.
| Constructor | Description |
|---|---|
| OnlineIdServiceTicketRequest(String) | Creates an instance of the OnlineIdServiceTicketRequest class. |
| OnlineIdServiceTicketRequest(String, String) | Creates an instance of the OnlineIdServiceTicketRequest class. |
Methods
The OnlineIdServiceTicketRequest class inherits methods from the Object class (C#/VB/C++).
Properties
The OnlineIdServiceTicketRequest class has these properties.
| Property | Access type | Description |
|---|---|---|
| Read-only | 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. | |
| Read-only | 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. |
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(); }); }
Requirements
|
Minimum supported client | Windows 8 [Windows Store apps only] |
|---|---|
|
Minimum supported server | Windows Server 2012 [Windows Store apps only] |
|
Minimum supported phone | Windows Phone 8 |
|
Namespace |
|
|
Metadata |
|
Build date: 3/14/2013
