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?

  • 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:


| 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.

| 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.


| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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