Has anyone integrated an iPhone application with a Shibboleth Identity Provider? Googling did not come up with anything so I am asking the gurus directly.
If it has not been previously dones, is it feasible to do so?
Has anyone integrated an iPhone application with a Shibboleth Identity Provider? Googling did not come up with anything so I am asking the gurus directly.
If it has not been previously dones, is it feasible to do so?
The answer to both is "Yes."
I'm a Java guy, so being asked two weeks ago to:
...Was a little daunting. Compound that with the absence of any forum posts to help out has prompted me to share my experience.
Here's an overview followed by some hopefully very helpful sample code. Please vote for my answer if this helps! It worth a few weeks of my time :)
For an application on the iPhone to download Shibbolized resources, the following needs to happen:
Here are some useful references from Apple and Shibboleth:
And hopefully I can include all the source for a quick demonstration.
I managed to do just that, but it took me some time to understand every step of the process and to reproduce it perfectly. If I have time, I might write a detailed tutorial, because I didn't find any help for a lot of problems I got. The thing is, it also depends on the website you want to connect to, so yours maybe does not follow the same path as mine (its process is the same as the one described here).
To see every request fired by my browser (Chrome) to connect, I used the developer tools Network panel, with 'Preserve log' checked.
A few hints :
1°) You need to get "_idp_authn_lc_key..." cookie. There's a request that set it for you, find it.
2°) You need the login ticket (LT-...). You'll probably find it in the body of the page that asks you your credentials.
3°) You need a service ticket (ST-...). Again, you will find it in the page that the previous request returned.
4°) You need SAMLResponse. Again, you will find it in the page that the previous request returned.
5°) Finally, you can log in by sending back SAMLResponse to the service provider. You should take care of the encoding, here. I had a few '+' or '=' that I needed to change to '%2B' and '%3D'. You will be given a "_idp_session" cookie, that will allow you to reconnect without all this mess.
If someone tries to do the same, I'd be happy to help ! Just send me a message.
I successfully implemented using EC's solution as a starting point. The only other thing I'd add is that you really have to pay attention to keeping only one request going at a time. In our implementation the authentication process would get confused between multiple asynchronous requests running concurrently. Using NSOperation to throttle the queue seemed to work great for me.