Skip to content

batuhankok/github-oauth2-demo

Repository files navigation

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 ✋

About

GitHub OAuth Login with Swift 4 & Alamofire

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published