CocoaPods trunk is moving to be read-only. Read more on the blog, there are 8 months to go.

WebAuthentication 0.2.0

WebAuthentication 0.2.0

Maintained by catchakos.



  • By
  • InQBarna

WebAuthentication

Version License Platform

Example

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

Substitute the values for constructing a valid AuthConfiguration for your service and run.

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, [email protected]

License

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