Printer Friendly Version      Send     
Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
Windows Live
 IDLoginStatus Control
Windows Live
IDLoginStatus Control

This topic describes the parameters and default values created when you add the IDLoginStatus control to enable Windows Live™ ID authentication on a Web page.

<live:IDLoginStatus 
      ID="id" />

The parameters shown in the syntax section and in the beginning of the parameters table are the parameters created when dragging the control from the Toolbox and dropping it on a Web page. The default values in the description are also those created when dragging the control from the Toolbox and dropping it on a Web page.

Parameter Description

ID

Required. The unique identifier for the control on the Web page. The default value is IDLoginStatus1.

ApplicationContext

Optional. A string containing state information. For example, if your home page is www.fabrikam.com and the user is on the www.fabrikam.com/contactus.aspx page, you can pass contactus.aspx as context, and when the user is redirected back to www.fabrikam.com, you can redirect them to www.fabrikam.com/contactus.aspx.

ApplicationIDConfigKey

Required. A string specifying the name of the <appSettings> key that contains the value of the Application ID for the application. This parameter is available throughout the smart tag (the arrow in the upper right corner of the control in Design view). Set this to wll_appid.

ApplicationSecretConfigKey

Required. A string specifying the name of the <appSettings> key that contains the value of the secret key. This parameter is available through out the smart tag (the arrow in the upper right corner of the control in Design view). Set this to wll_secret.

AutomaticallyConvertAuthentication

Optional. Whether to automatically log in a user who has logged in with a Windows Live ID and who has previously associated that ID with an ASP.NET profile on the Web page. See the IDLoginView Control for more information.

The IDLoginStatus control enables you to use a Windows Live ID to authenticate users.

When users browse to your site, they are presented with a link to log in. When they click the link, they are taken to the Windows Live ID login page where they can log in with their Windows Live ID. Once Windows Live has authenticated them, they are redirected to the page you set up when you registered your application.

The IDLoginStatus control contains a number of read-only properties that you can access.

Property Description

Action

A string containing the action that the user is doing. The possible values are:

Login means the user is signed into the site.

Logout means the user is signed out from Windows Live. You should clear any of the user's cookies and display the default, signed out page.

Clearcookie means the Windows Live ID Sign Out page is calling your site to clear user cookies.

ApplicationUserID

A string containing the unique identifier for the signed-in user.

TimeStamp

A 32-bit integer that represents the time in seconds that the user last authenticated, as measured from January 1, 1970 GMT.

LoggedInLiveID

A Boolean value containing information about whether the user has signed into Windows Live.

True means the user is signed in with a Windows Live ID.

False means the user is not signed in with a Windows Live ID.

The IDLoginStatus control can raise both server and client events. Server events occur before client events and are handled in server-side code that you write for the Web page. Client events are handled in client script, typically ECMAScript (JavaScript), and are raised after server events. The server-side events are triggered even if client-side events are not present.

Event Designation: Server or Client Description

OnClientSignIn

Client

Raised when the user signs in.

OnClientSignOut

Client

Raised when the user signs out.

OnServerSignIn

Server

Raised when the user signs in.

OnServerSignOut

Server

Raised when the user signs out.

OnClientSignIn Event

A client event that is raised when the user signs in.

JavaScript Syntax

function OnClientSignInHandler(sender, args)

Parameters

Parameter Description

sender

The DOM element raising the event.

args

The event arguments object. This object has the methods get_cancel and set_cancel.

Remarks

Use the set_cancel method to cancel the execution of the associated server event.

OnClientSignOut Event

A client event that is raised when the user signs out.

JavaScript Syntax

function OnClientSignoutHandler(sender, args)

Parameters

Parameter Description

sender

The DOM element raising the event.

args

The event arguments object. This object has the methods get_cancel and set_cancel.

Remarks

Use the set_cancel method to cancel the execution of the associated server event.

OnServerSignIn Event

A server event that is raised when the user signs in.

C# Syntax

using Microsoft.Live.ServerControls;
…
protected void OnServerSignInHandler(object sender, AuthEventArgs e)

Parameters

Parameter Description

sender

The IDLoginStatus object.

e

The AuthEventArgs object. It has the following members, which help identify the user who signed in:

Action

ApplicationContext

ApplicationUserID

TimeStamp

OnServerSignOut Event

A server event that is raised when the user signs out.

C# Syntax

using Microsoft.Live.ServerControls;
…
protected void OnServerSignOutHandler(object sender, AuthEventArgs e)

Parameters

Parameter Description

sender

The IDLoginStatus object.

e

The AuthEventArgs object. The AuthEventArgs class is derived from the EventArgs class and has the following members, which are accessible during server-side event handling to help identify the user who signed out:

Action

ApplicationContext

ApplicationUserID

TimeStamp

© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker