iOS Dev Nugget 256 SFAuthenticationSession for Login Protocols and Single Sign On


Need to run a code review on your codebase? Hire me

iOS 11 introduces a new class SFAuthenticationSession which supports Single Sign On (SSO) securely.

It's simple to use!

NSURL* url = [NSURL URLWithString:@"https://the_url_end_point_for_authentication_with_tokens_etc"];
[[SFAuthenticationSession alloc] initWithURL:url callbackURLScheme:nil completionHandler:^(NSURL *callbackURL, NSError *error) {
    //Inspect callbackURL to get the access tokens, etc for the login session

A major benefit of using SFAuthenticationSession is that it runs in a separate process so the user can be confident that the app does not have a way to sniff the password. This is very useful for login protocols such as OAuth or SSO across multiple related applications.

Your feedback is valuable: Do you want more nuggets like this?   Yes   or   No



Like this and want such iOS dev nuggets to be emailed to you, weekly?

Sign Me Up! or follow @iosdevnuggets on Twitter


View archives of past issues