Disable / Stop Single Sign On Option using WebAuthenticationBroker RRS feed

  • Question

  • Hi All,

    I am developing a Windows Store App which requires user to authenticate using Yammer credentials. I have written the following code to achieve the functionality

    var client_id = <<My Client ID >>;
                var client_secret = <<My Client Secret>>;
                string redirectURI = WebAuthenticationBroker.GetCurrentApplicationCallbackUri().ToString();
                string loginURI = "https://www.yammer.com/dialog/oauth?client_id=" + client_id + "&redirect_uri=" + redirectURI;
                var result = await WebAuthenticationBroker.AuthenticateAsync(WebAuthenticationOptions.None, new Uri(loginURI), new Uri(redirectURI));
                if (result.ResponseStatus == WebAuthenticationStatus.Success)
                    var response = result.ResponseData;
                    string[] keyValPairs = response.Split('=');
                    HttpClient client = new HttpClient();
                    string url = "https://www.yammer.com/oauth2/access_token.json?client_id=" + client_id + "&client_secret=" + client_secret + "&code=" + keyValPairs[1];
                    HttpResponseMessage JSONresponse = await client.GetAsync(url);
                    string content = await JSONresponse.Content.ReadAsStringAsync();

    When I ran the app for the first time it asked me for my credentials and I was able to login.

    Now when I run my app , it takes my previous entered credentials and logs in automatically. I am sure that I did not check "Keep Me signed In" option. 

    I want the app to ask for credentials every time I run it. 

    Please help and thanks in advance.

    Thursday, January 2, 2014 6:11 AM


  • You should look at explicitly logging the client out on suspend/terminate.  The Yammer API set should be able to tell you how to do this.

    Also, are you sure that you terminated the app, or did you just suspend it?

    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.

    Thursday, January 2, 2014 8:05 PM