GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - calebd/SimpleAuth: Simple social authentication for iOS.

This repository was archived by the owner on Aug 16, 2023. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

231 Commits
231 Commits

Folders and files

NameName
Last commit message
Last commit date
Example
Example
 
 
Pod
Pod
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
Readme.markdown
Readme.markdown
 
 
SimpleAuth.podspec
SimpleAuth.podspec
 
 

Repository files navigation

SimpleAuth

SimpleAuth is designed to do the hard work of social account login on iOS. It has a small set of public APIs backed by a set of "providers" that implement the functionality needed to communicate with various social services.

SimpleAuth currently has the following providers:

  • Twitter
  • Facebook
  • Instagram
  • Tumblr
  • Dropbox
  • Foursquare
  • Meetup
  • LinkedIn
  • Sina Weibo
  • Google
  • Box
  • OneDrive

Installing

Install SimpleAuth with CocoaPods. For example, to use Facebook and Twitter authentication, add

pod 'SimpleAuth/Facebook'
pod 'SimpleAuth/Twitter'

to your Podfile.

Usage

Configuring and using SimpleAuth is easy:

// Somewhere in your app boot process
SimpleAuth.configuration()["twitter"] = [
    "consumer_key": "KEY",
    "consumer_secret": "SECRET"
]
// Authorize
func loginWithTwitter() {
    SimpleAuth.authorize("twitter", completion: { responseObject, error in
        println("Twitter login response: \(responseObject)")
    })
}

Implementing a Provider

The API for creating providers is pretty simple. Be sure to look at SimpleAuthProvider and SimpleAuthWebLoginViewController. These classes will help you simplify your authentiction process. Providers should be stored in Pod/Providers/ and have an appropriately named folder and sub spec. All providers are automatically registered with the framework. There are a handful of methods you'll need to implement:

Let SimpleAuth know what type of provider you are registering:

+ (NSString *)type {
    return @"facebook";
}

Optionally, you may return a set of default options for all authorization options to use:

+ (NSDictionary *)defaultOptions {
    return @{
        @"permissions" : @[ @"email" ]
    };
}

Finally, provide a method for handling authorization:

- (void)authorizeWithCompletion:(SimpleAuthRequestHandler)completion {
	// Use values in self.options to customize behavior
	// Perform authentication
	// Call the completion
}

The rest is up to you! I welcome contributions to SimpleAuth, both improvements to the library itself and new providers.

License

SimpleAuth is released under the MIT license.

Thanks

Special thanks to my friend @soffes for advising on the SimpleAuth API design.

Contributors

  • kornifex: Foursquare provider
  • mouhcine: Meetup provider
  • iamabhiee: LinkedIn provider
  • aschuch: Sina Weibo provider

About

Simple social authentication for iOS.

simpleauth.io

Resources

Readme
License
Activity

Stars

1.1k stars

Watchers

1 watching

Forks

128 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.