Ping Browser
Overview
Ping Browser is a library that allows you to instantiate and use an in-app browser for performing OIDC flows.
This library act as a plugin to the External_idp
library,
and it provides the necessary configuration to launch the browser to authenticate with the External IDP.
Add dependency to your project
You can add the dependency using Cocoapods or Swift Package manager
Usage
The PingBrowser
is used internally in the External_idp
module. You can use the PingBrowser
in standalone mode by calling the following:
await BrowserLauncher.currentBrowser?.launch(url: request.urlRequest.url!, customParams: nil, browserType: .authSession, browserMode: .login, callbackURLScheme: callbackURLScheme)
BrowserLauncher configuration
The BrowserLauncher
has the following public methods:
Reset()
launch(url: URL, customParams: [String: String]? = nil, browserType: BrowserType = .authSession, browserMode: BrowserMode = .login, callbackURLScheme: String) async throws -> URL
The BrowserLauncher
supports the following types of BrowserMode
(Not fully implemented yet):
login
logout
custom
The BrowserLauncher
supports the following types of BrowserType
(Not fully implemented yet):
authSession
<– DefaultsfViewController
nativeBrowserApp
ephemeralAuthSession
At the current time only authSession
and ephemeralAuthSession
are implemented. Both types rely on the ASWebAuthenticationSession
in-app browser type.