SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to create an IOS app that connects to my Office365 SharePoint team site using the list rest services. How do I do authentication? Any examples?

share|improve this question
Did you find the answer? – surlac Sep 20 '12 at 12:29

Can't mark it as a duplicate, but this should answer your question:

share|improve this answer
Will this work for claims based authentication in Office 365? – HaavardMeling Sep 25 '11 at 11:37
Did you ever find out if it works with claims based auth? I'm having the same issue. – Ryan Jun 19 '12 at 14:31
Unfortunately I have no idea, sorry. Anyone else? – James Love Jun 19 '12 at 18:24

As far as I know, you need to:
1) open UIWebView and direct user to authentication page of Identity Provider (Office 365, Google, etc.);
2) get FedAuth:

- (void)webViewDidFinishLoad:(UIWebView *)webView {
    NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
    NSArray *cookiesArray = [storage cookies];
    for (NSHTTPCookie *cookie in cookiesArray) {
        if ([[cookie name] isEqualToString:@"FedAuth"]) {


3) attach this token to every request you make to SharePoint services.

share|improve this answer
This works, but the problem is, from what I understand, the cookie expires after 24 hours. So it's a pain to have to login every time you want to do some work. – reallyseth Oct 9 '13 at 19:09
you also need rtFa cookie! you need to add them both with every request – Radu Simionescu Mar 21 '14 at 17:53

You can try OAuth authentication. Check below link which has all the steps explained in detail.


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.