-2

I am making a windows phone 7 application tha requires login. I figure since it is a windows phone application that I might as use if possible windows live authentication as everyone who has a windows phone should have an account(otherwise they would not be able to download the app in the first place)

Does anyone have any tutorials on how to use windows live ouath?

chobo2
  • 83,322
  • 195
  • 530
  • 832

1 Answers1

0

You can start from here. A lot samples and docs.

You can use LiveSdk without await/async. Use events:

  liveAuthClient = new LiveAuthClient( clientId );
  liveAuthClient.InitializeCompleted += LiveAuthClientInitializeCompleted;
  liveAuthClient.LoginCompleted += LiveAuthClientInitializeCompleted;
  liveAuthClient.InitializeAsync( liveScopes );

  private void LiveAuthClientInitializeCompleted( object sender, LoginCompletedEventArgs e )
    {
     if ( e.Error == null )
     {
      sessionStatus = e.Status;
      ...
crea7or
  • 4,421
  • 2
  • 26
  • 37
  • Cool, but this tutorial(http://msdn.microsoft.com/en-us/library/live/hh826550.aspx) does not work with V5.5. This line seems wrong LiveOperationResult operationResult = await client.GetAsync("me"); as it can't accept "await" – chobo2 Feb 13 '14 at 17:33
  • Use [Microsoft addon for await/async](http://www.nuget.org/packages/Microsoft.Bcl.Async/). But avoid using dynamic types. – crea7or Feb 13 '14 at 17:53
  • Yea I tried that but that is not the problem. The 'await' operator can only be used within an async method. Consider marking this method with the 'async' modifier and changing its return type to 'Task'. If I remove then I get Cannot implicitly convert type 'System.Threading.Tasks.Task' to 'Microsoft.Live.LiveOperationResult'......I also found this http://msdn.microsoft.com/en-us/library/live/hh826543#csharp what seems a totally different way to log people in....I am very confused right now. – chobo2 Feb 13 '14 at 18:15
  • Hmm. Seems like there is many different ways how to login. I was just trying to follow that tutorial but it seems like it is wrong and returns different stuff. – chobo2 Feb 13 '14 at 19:03
  • Not yet, I was referring to the tutorial. I will try it once I can get the emulator to connect to the internet...it keeps dieing. – chobo2 Feb 13 '14 at 19:29
  • what triggers you code? Are you using it with some sort of button? – chobo2 Feb 16 '14 at 01:18
  • Explicit user action (upload to skydrive) and at opening the page with files (on Loaded event). – crea7or Feb 16 '14 at 02:00