locked
WebAuthenticationBroker doesn't return oauth_verifier in ResponseData

    Question

  • I am building a Windows 8 app that connects to a service that utilizes oAuth 1.0a. In my app I am trying to use the WebAuthenticationBroker for the Authorization step. The issue I'm running into is that the ResponseData from the Broker is only returning the callback url without the oauth verifier appended. The verifier code appears in the body of the callback url page as plain text, but I am unable to retrieve that data with the Broker.

    Here is my code:

    public async Task<string> Authorize(string oAuthAuthorizeUrl)
    {
        System.Uri StartUri = new Uri(oAuthAuthorizeUrl);
        System.Uri EndUri = new Uri("http://oauth-api.beatport.com/identity/1/oauth/authorize-submit");
    
        var auth =
            await
            WebAuthenticationBroker.AuthenticateAsync(WebAuthenticationOptions.None, StartUri, EndUri);
    
        var responseStatus = auth.ResponseStatus;
        var responseText = auth.ResponseData; // Callback url specified above gets returned here
        ...
    }

    Here is a snap shot of what gets returned in the ResponseData

    Is there any way I can get the data from the HTML page with the Broker?



    Saturday, January 10, 2015 2:49 AM

Answers

All replies

  • Hi TKx421x,

    From the description of MSDN documentation, ResponseData includes the entire URL for HTTP GET. For POST, the property is the entity body. You can see more from http://msdn.microsoft.com/en-us/library/windows/apps/windows.security.authentication.web.webauthenticationresult.responsedata.aspx. Please use POST request to get the entity body.

    If not help, please post more information about your scenario.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.

    Monday, January 12, 2015 5:51 AM
    Moderator
  • When you say to use a POST request are you talking about setting the WebAuthenticationOptions to useHttpPost or something else?

    Thanks


    • Edited by TKx421x Monday, January 12, 2015 10:03 PM
    Monday, January 12, 2015 10:02 PM
  • Hi TKx421x,

    Yes. Have you tried this property? Please try and let me know the result. Note WebAuthenticatjionOptions.UseHttpPost is used with single sign-on (SSO) only. If this is not your scenario, please post more information about your issue.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.

    Tuesday, January 13, 2015 6:52 AM
    Moderator
  • I'm not using SSO so UseHttpPost will not work. I've also tried UseHttpTitle, but when using that option the Broker ignores my CallBackUrl and does not stop after the user has authorized my app like it should. Is there anything else i can try with the broker? I've been suck on this for a long time and I think my only option would be to host authorization page within my app using a WebView control.

    • Edited by TKx421x Wednesday, January 14, 2015 8:28 PM
    Wednesday, January 14, 2015 4:36 PM
  • Hi TKx421x,

    The MSDN page says “You can use the web authentication broker to enable single sign-on for your users and ….”, so please check if this class is suitable for your scenario. See more here. https://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh750287.aspx.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.

    Wednesday, January 21, 2015 8:45 AM
    Moderator