AuthenticatedCallback Delegate

Ff752068.note(en-us,MSDN.10).gifNote:
Current information about Live Connect is now available in the Windows Live Developer Center. The information in the following sections is provided for legacy purposes only.

Represents a delegate that is invoked when authentication is complete.

Script:  http://js.live.net/4.1/loader.js
Feature:  Microsoft.Live
Namespace:  Microsoft.Live
 

function authenticatedCallback(args) {

}

Parameters

args
Type: AuthenticationCompletedEventArgs

The event arguments that are passed after authentication is complete.

When you work with the communication and sharing features of Windows Live Messenger Connect, you work with a data context for these features. To get the data context from the App instance, call the messengerContext property. From the messengerContext property, you can specify the AuthenticatedCallback as a parameter for the Microsoft.Live.IMessengerContext.onAuthenticated method.

The following example demonstrates a function that is called after authentication is completed. The function takes an AuthenticationCompletedEventArgs object as a parameter. The example also demonstrates how the AuthState value is used to display an appropriate message to the user.

function appAuthenticated(authenticationCompletedEventArgs) {
    var auth = authenticationCompletedEventArgs.get_auth();
    switch (auth.get_state()) {
        case Microsoft.Live.AuthState.authenticated:
            alert("Authentication completed.");
            break;
        case Microsoft.Live.AuthState.failed:
            alert("Authentication failed.");
            break;
        default:
            alert("Authentication unsuccessful.");
            break;
    }
}

Windows Live Messenger Connect

Supported in: 4.1

Internet Explorer 8.0, Internet Explorer 7.0, Internet Explorer 6.0, Firefox 3.6, Firefox 3.5, Firefox 3.0, Firefox 2.0, Firefox 1.5, Chrome 4.0, Chrome 3.0, Chrome 2.0, Chrome 1.0, Safari 4.0, Safari 3.0

Show: