Tell me more ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

2 Answers

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

http://stackoverflow.com/questions/1557040/objective-c-best-way-to-access-rest-api-on-your-iphone

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.

NSURLRequest.setAllHTTPHeaderFields()
share|improve this answer

Your Answer

 
discard

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.