locked
How can I extract POST data from a WebAuthenticationBroker result

    Question

  • I'm trying to authenticate a user using SoundCloud, I've managed to get the Broker and the result I get is as follows.

    http://website.co.uk/callback.php?#access_token=X-XXXXX-XXXXXX-XXXXXXXXXXXXXXXXX&scope=non-expiring

    I want to extract the access_token but I can't seem to find any useful utility for doing so and want to avoid using string manipulation.

    Wednesday, June 26, 2013 9:43 AM

Answers

  • If the above result is returned as part of the response: WebAuthenticationResult.ResponseData, then you can use the Windows.Foundation.Uri("uri string above") to extract the fragment (contents of the #). Once you get that you can get back your access_token by splitting the string on the & character.

    Thanks,

    Prashant.


    @prashantphadke || Windows Store Developer Solutions #WSDevSol || Want more solutions? See our blog, Windows Store & Phone Developer Solutions

    Thursday, June 27, 2013 3:10 PM
    Moderator