- SPM
- Cocoapods:
pod 'WebAuthentication'
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
catchakos, [email protected]
WebAuthentication is available under the MIT license. See the LICENSE file for more info.