Using UiWebView and Monotouch with Azure ACS

2019-07-13 04:38发布

问题:

I'm trying to figure out how to use Azure ACS on the iPhone, via Monotouch. It looks like it should be possible to simply point a UiWebView at the right address, let the user pick their IP, ad then sign in. After that the cookie should contain the required info.

Getting the NSHttpCookie and translating it to a System.Net.Cookie looks easy: How do I convert an NSHttpCookie to a System.Net.Cookie in MonoTouch?

However, I can't figure out the first part. I've tried pointing the UIWebView at all the Endpoints in the management console. None of them display the IPs.

Do I need to do something in the Relaying Party Applications? Perhaps create a new app? Does anyone know what the settings would be? It's easy for an Azure website, but I can't figure it out for a mobile app.

Has anyone done this? Any ideas? Thanks a Million, Chris

回答1:

it sounds like you have most of the scenario working, but I think you're looking for the SWT in the wrong place. ACS doesn't write the SWT to the cookie, rather it returns the SWT by way of a WS-Federation Passive response, look for the wresult parameter in the response body.

Also, this might be of help to you:

http://www.wadewegner.com/2011/07/windows-azure-toolkit-for-ios-now-supports-the-access-control-service/