IGAuth 1.1.0

IGAuth 1.1.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Sep 2017
SwiftSwift Version 4.0
SPMSupports SPM

Maintained by Ander Goig.




IGAuth 1.1.0

  • By
  • AnderGoig

IGAuth allows iOS developers to authenticate users by their Instagram accounts.

IGAuth handles all the Instagram authentication process by showing a custom UIViewController with the login page and returning an access token that can be used to request data from Instagram.

Inspired by projects like InstagramAuthViewController and InstagramSimpleOAuth, because of the need for a simple and easy way to authenticate Instagram users.

IGAuth Demo (GIF)

Features

  • [x] Customizable Options
  • [x] Multiple Accounts Login
  • [x] 1Password Extension Support
  • [ ] More Coming...

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Second, edit the Constants.swift file with your client info from Instagram's developer portal:

let clientID = "YOUR CLIENT ID GOES HERE"
let redirectURI = "YOUR REDIRECT URI GOES HERE"

Third, go ahead and test it! 🚀

Requirements

  • iOS 9.0+
  • Xcode 9.0+
  • Swift 3.2+

Installation

Manual installation

Simply copy the file IGAuthViewController.swift from IGAuth/Classes into your project.

Usage

let clientID = "YOUR CLIENT ID GOES HERE"
let redirectURI = "YOUR REDIRECT URI GOES HERE"
  • Initialize your IGAuthViewController:
let vc = IGAuthViewController(clientID: clientID, redirectURI: redirectURI) { (accessToken) in
    guard let accessToken = accessToken else {
        print("Failed login")
        return
    }

    DispatchQueue.main.async {
        self.navigationController?.popViewController(animated: true)
        // Do your stuff ...
    }
}
  • Customize it:
// Login permissions (https://www.instagram.com/developer/authorization/)
vc.authScope = "basic+public_content" // basic by default

// ViewController title, website title by default
vc.customTitle = "Instagram" // By default, the web title is displayed

// Progress view tint color
vc.progressViewTintColor = UIColor.green // #E1306C by default

// 1Password integration
vc.allowOnePasswordIntegration = false // true by default
  • Show it:
show(vc, sender: self)

Contributing to this project

If you have feature requests or bug reports, feel free to help out by sending pull requests or by creating new issues. Please take a moment to review the guidelines written by Nicolas Gallagher:

License

IGAuth is available under the MIT license. See the LICENSE file for more info.

Credits

IGAuth is brought to you by Ander Goig and contributors to the project. If you're using IGAuth in your project, attribution would be very appreciated.

Author

Ander Goig, [email protected]

https://github.com/AnderGoig/IGAuth