<commit_before># 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](https://github.com/calebd/SimpleAuth/wiki/Twitter)
- [Facebook](https://github.com/calebd/SimpleAuth/wiki/Facebook)
- [Instagram](https://github.com/calebd/SimpleAuth/wiki/Instagram)
- [Tumblr](https://github.com/calebd/SimpleAuth/wiki/Tumblr)
- [Dropbox](https://github.com/calebd/SimpleAuth/wiki/Dropbox)
- [Foursquare](https://github.com/calebd/SimpleAuth/wiki/Foursquare)
- [Meetup](https://github.com/calebd/SimpleAuth/wiki/Meetup)

## Installing

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

```ruby
pod 'SimpleAuth/Facebook'
pod 'SimpleAuth/Twitter'
```

to your `Podfile`.

## Usage

Configuring  and using SimpleAuth is easy:

````objc
// Somewhere in your app boot process
SimpleAuth.configuration[@"twitter"] = @{
    @"consumer_key" : @"KEY",
    @"consumer_secret" : @"SECRET"
};
````

````objc
// Authorize
- (void)loginWithTwitter {
    [SimpleAuth authorize:@"twitter" completion:^(id responseObject, NSError *error) {
        NSLog(@"%@", 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 `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:

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

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

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

Finally, provide a method for handling authorization:

````objc
- (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](https://twitter.com/soffes) for advising on the SimpleAuth API design.

### Contributors

- [kornifex](https://github.com/kornifex): Foursquare provider
- [mouhcine](https://github.com/mouhcine): Meetup provider<commit_msg>Add LinkedIn to readme.<commit_after># 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](https://github.com/calebd/SimpleAuth/wiki/Twitter)
- [Facebook](https://github.com/calebd/SimpleAuth/wiki/Facebook)
- [Instagram](https://github.com/calebd/SimpleAuth/wiki/Instagram)
- [Tumblr](https://github.com/calebd/SimpleAuth/wiki/Tumblr)
- [Dropbox](https://github.com/calebd/SimpleAuth/wiki/Dropbox)
- [Foursquare](https://github.com/calebd/SimpleAuth/wiki/Foursquare)
- [Meetup](https://github.com/calebd/SimpleAuth/wiki/Meetup)
- [LinkedIn](https://github.com/calebd/SimpleAuth/wiki/Meetup)

## Installing

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

```ruby
pod 'SimpleAuth/Facebook'
pod 'SimpleAuth/Twitter'
```

to your `Podfile`.

## Usage

Configuring  and using SimpleAuth is easy:

````objc
// Somewhere in your app boot process
SimpleAuth.configuration[@"twitter"] = @{
    @"consumer_key" : @"KEY",
    @"consumer_secret" : @"SECRET"
};
````

````objc
// Authorize
- (void)loginWithTwitter {
    [SimpleAuth authorize:@"twitter" completion:^(id responseObject, NSError *error) {
        NSLog(@"%@", 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 `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:

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

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

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

Finally, provide a method for handling authorization:

````objc
- (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](https://twitter.com/soffes) for advising on the SimpleAuth API design.

### Contributors

- [kornifex](https://github.com/kornifex): Foursquare provider
- [mouhcine](https://github.com/mouhcine): Meetup provider
- [iamabhiee](https://github.com/iamabhiee): LinkedIn provider
{'fraction_non_alphanumeric': 0.11895718232044199, 'fraction_numerical': 0.0, 'mean_word_length': 4.701771653543307, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 22, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5658117', 'n_tokens_mistral': 1765, 'n_tokens_neox': 1638, 'n_words': 552}