Skip to content

Facilitates authentication by providing a configured web environment depending on the iOS version

License

Notifications You must be signed in to change notification settings

InQBarna/WebAuthentication

Repository files navigation

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

License

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

About

Facilitates authentication by providing a configured web environment depending on the iOS version

Resources

License

Stars

Watchers

Forks

Packages

No packages published