Skip to content

Latest commit

 

History

History
35 lines (27 loc) · 1.62 KB

README.md

File metadata and controls

35 lines (27 loc) · 1.62 KB

GitHub OAuth2 Demo

GitHub OAuth2 Demo with Swift 4 & Alamofire

Programming Language GNU v3 License Twitter Website Contact

This demo application shows you how to implement GitHub login with OAuth2 to your apps in a VERY SIMPLE way. I researched OAuth2 authentication demo to use in my personal project, but there wasn't any simple one and everyone of them was full of little and hard to solve box. I decided to do it myself and share it with you.

Do not forget to change these:

  1. ViewController
// data from your Github app
let client_id = "your client id"
let client_secret = "your client scret"
let scope = "user repo:status"
let redirect_uris = ["githuboauth://oauth/callback"] // same with Github app settings
let token_uri = "https://github.com/login/oauth/access_token"
  1. AppDelegate
...
"githubauth" == url.scheme || (url.scheme?.hasPrefix("me.batuhan.GitHubAuth")) // change the schemes
...

Hope you enjoy it and find it useful 🤓

Note: I could defined the whole project: "It just works". Sorry for that ✋