locked
Sign in to multiple Microsoft account in Windows Store app

    Question

  • Is it possible to:

    • sign-in to multiple Microsoft accounts in a Windows Store app?
    • sign-in to Microsoft account that is not the one used for logging in to Windows?

    I tried something like the following (taken from Live SDK sample code) but it only sign me in with the account I used to log in to Windows

    var client = new LiveAuthClient();
    var result = await client.LoginAsync(new[] { "wl.basic" });
    
    if (result.Status == LiveConnectSessionStatus.Connected)
    {
        this.AddAccountButton.Content = "connected";
    }


    I used to be hesitant, but now, I'm not sure :)

    Friday, April 04, 2014 6:11 PM

All replies

  • 1) No

    2) Yes, I believe this is possible, as we do it in the Store.  I'd have to research this more.  Please ping this again on Monday so it doesn't fall off the radar.


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Friday, April 04, 2014 7:44 PM
    Moderator
  • Thanks Matt; appreciate your response.

    1. Why not? How does Mail app do it? Does it use something that's not available for non-Microsoft developers? It asks me for my username and password and authenticate me this way. Can I do the same?

    2. I'm going to ping this on Monday :)


    I used to be hesitant, but now, I'm not sure :)

    Saturday, April 05, 2014 4:48 AM
  • 1. I don't know. I assume it's because only one person at a time should be logged into any account. Getting email is not the same as being logged into an account.

    2. I believe this page has the code you need to sign into alternate accounts: http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh968445.aspx


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Monday, April 07, 2014 1:10 PM
    Moderator
  • Hello Matt,

    1. So, does Mail app use something that's not available for the rest of us? My requirement is similar to Mail app. Think of a contacts app, or an app with integrations to user's multiple calendars. There are plenty of scenarios where signing in to multiple accounts makes sense. Well, to be clearer, I don't necessarily want the user to sign in to the app, I want to user to give the app the permission to access their data on multiple accounts; think Mail, People and calendar apps. Is there a way? In a Desktop application, I can use REST API's and the browser control to do this. Is this scenario supported in Windows Store apps? Does using this will make my app fail the certificate test?

    2. The link in your post is one of the first I read. Unfortunately, it does not tell how sign in with a different account. I tried the example as described but the app didn't even "bother" to prompt me to enter my username and password. Note: this is probably because I'm sign in to my PC using my Microsoft account and gave permission to apps to access my basic profile information. However, the Store app does it, can’t we?

    I hope you can help me to find the answers


    I used to be hesitant, but now, I'm not sure :)

    Monday, April 07, 2014 4:27 PM