Skip to content

Latest commit

 

History

History
46 lines (36 loc) · 1.56 KB

README.md

File metadata and controls

46 lines (36 loc) · 1.56 KB

WebAuthentication

Version License Platform

Installation

  • SPM
  • Cocoapods:
pod 'WebAuthentication'

Usage

Create an AuthConfiguration instance with the corresponding parameters:

let config = AuthConfiguration(
    authCallbackURLScheme: ProfileConstants.authURLScheme,
    authCallbackTokenQueryParamName: ProfileConstants.authTokenQueryName,
    authStatusChangedNotificationName: Notifications.authStatusChanged,
    authStatusChangedNotificationInfo: ProfileConstants.authTokenQueryName)

Use it to instantiate a WebAuthentication :

let authenticator = WebAuthentication(configuration: authConfig)

Call display method passing a UIViewController that will act as the presenter of the login process

authenticator?.display(url, from: viewController!, completion: { _ })

Important: If your app supports an older version of iOS 12, you are responsible for handling the service callback and infering the token in AppDelegate's:

application(_: , open url:, options _: ) -> Bool 

Author

catchakos, alexis.katsaprakakis@inqbarna.com

License

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