MBGithubOAuthClient 0.0.1

MBGithubOAuthClient 0.0.1

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by Unclaimed.


Downloads

Total22
Week0
Month0

Installs

Apps4
powered by Segment

GitHub

Stars22
Watchers4
Forks7
Issues0
Contributors1
Pull Requests0

Code

Files2
LOCLines of Code 153



  • By
  • Michael Babiy and John Clem

MBGithubOAuthClient is a dead simple wrapper class for performing OAuth requests on Github.

MBGithubOAuthClient is a dead simple wrapper class for performing OAuth requests on Github. In addition to authentication, it offers 2 ways of saving access token - user defaults or iOS keychain.

What is It?

MBGithubOAuthClient takes advantage of NSURLSession and a singleton pattern to setup proper authorization requests.

Setup

The easiest way to implement MBGithubOAuthClient is as a cocoa pod. Add the following line to your Podfile:

pod “MBGithubOAuthClient”

How To Use

  1. Register your app with GitHub to get client ID and client secret code.

  2. Get a pointer to your singleton instance.

MBGithubOAuthClient *githubClient = [MBGithubOAuthClient clientWithID:kGithubClientID andSecret:kGithubClientSecret];

  1. Setup initial parameters for GitHub access request (https://developer.github.com/v3/oauth/) and let MBGithubOAuthClient do the rest.

[githubClient oauthRequestWithParameters:@{ @"client_id" : githubClient.githubClientID, @"scope" : @"email,user" }];

  1. After successful authentication, you will be able to access your token by calling accessToken on your singleton.

[[MBGithubOAuthClient sharedClient]accessToken];

Feel free to send pull requests for fixes or create issues to request a new feature.

Thank you.

Installation

pod 'MBGithubOAuthClient'

Authors

Michael Babiy and John Clem

License

MIT