Note that there are some explanatory texts on larger screens.

plurals
  1. POGetting ACS token on windows store app using callback Uri
    text
    copied!<p>I've been following the steps to make Windows 8 Store app get an ACS token as described here: <a href="https://stackoverflow.com/questions/12485665/does-the-webauthenticationbroker-work-in-windows-8-metro-app-post-release-candid">Does the WebAuthenticationBroker work in Windows 8 Metro App post Release Candidate</a></p> <p>However, the ResponseData property of my WebAuthenticationResult object only contains the callback uri as specified in ACS, and contains no token information. Below my code.</p> <p><strong>Authentication method of Windows 8 client</strong></p> <pre><code>private async void Authenticate() { WebAuthenticationResult webAuthenticationResult = await WebAuthenticationBroker.AuthenticateAsync( WebAuthenticationOptions.None, new Uri("https://myACSnamespace.accesscontrol.windows.net:443/v2/wsfederation?wa=wsignin1.0&amp;wtrealm=http://localhost:12714/"), new Uri("http://mypublicIPaddress:80/WebAppMVCAPI/api/federation/end")); </code></pre> <p>My <em>Relying Party application</em> Return URL is set to <code>http://mypublicIPaddress:80/WebAppMVCAPI/api/federation/en</code></p> <p>My controller on the web application is programmed as follows:</p> <pre><code>public class FederationController : ApiController { protected virtual string ExtractBootstrapToken() { return "Hello World"; //return HttpContext.Current.User.BootstrapToken(); } [HttpGet] public string Get() { return "Hello Get World"; } [HttpPost] public HttpResponseMessage Post() { var response = this.Request.CreateResponse(HttpStatusCode.Redirect); response.Headers.Add("Location", "/WebAppMVCAPI/api/federation/end?acsToken=" + ExtractBootstrapToken()); return response; } } </code></pre> <p>}</p> <p>As you can imagine, the web application is running on my IIS Server and listening on port 80. My router is configured to forward incoming requests as needed, and when I launch my web application in visual studio I have access to the application from an internet host.</p> <p>The idea is to have the Windows 8 store app get a token from ACS with a Facebook login. When I launch the win8 client, the application shows a Facebook login page. I log in with my credentials successfully. However, when I look at the webauthenticationresult.responsedata property, I only see the callback uri. Also, I don't see any log in my firewall that ACS tried to post something to my callback uri. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload