Share via


LiveAuthClient.LoginAsync(IEnumerable<String>) method

Initiates the Microsoft account sign-in flow, or presents a Microsoft account consent page.

On the Windows Phone apps, you can use LoginAsync as an alternative to the sign-in control, or to prompt the user for additional permissions in the context of an activity.

On Windows Store apps, calling LoginAsync will display the system sign-in UI unless the user has already signed into their Microsoft account and given consent for the app to use the requested scopes. If the user has already signed in and given consent to the app, the user won't see any additional UI.

Syntax

public Task<LiveLoginResult> LoginAsync(
  IEnumerable<String> scopes
)
Public Function LoginAsync(
  scopes As IEnumerable<String> 
) As Task<LiveLoginResult>

Parameters

  • scopes

    Type: IEnumerable<String>

    A list of scopes that are needed by the app.

Return value

Type: Task<LiveLoginResult>

The user's login status and the session object.

Note

Doesn't return a value on a Windows Phone app.

Remarks

LoginAsync must be called from the app's UI thread.

Requirements

Minimum supported client

Windows 8

Minimum supported server

None supported

Minimum supported phone

Windows Phone 8

Namespace

Microsoft.Live

Assembly

Microsoft.Live.dll

See also

LiveAuthClient

LoginAsync(IEnumerable<String>, Object)