BrowserBasedAuthenticationHandler
open class BrowserBasedAuthenticationHandler: OnlineAuthenticationHandler
OnlineAuthenticationHandler
subclass for handling browser-based based online authentication.
Handles displaying an authentication web page, intercepting an Oauth2 redirect, and parsing the results.
-
Oauth2 redirect URI to use during the authentication process
Declaration
Swift
public var redirectURI: String
-
Query string key to use to provide the redirect URI to the login page.
Declaration
Swift
public var redirectURIQueryItemKey: String = "redirect_uri"
-
Query string key to use to provide the client id to the login page.
Declaration
Swift
public var clientIdQueryItemKey = "client_id"
-
Delegate used to interact with the controlling web UI view.
See also:
BrowserBasedAuthenticationHandlerDelegate
-SeeAlso: BrowserBasedAuthenticationHandlerDelegate
Declaration
Swift
public weak var authenticationBrowserDelegate: BrowserBasedAuthenticationHandlerDelegate?
-
Initializes and returns a BrowserBasedAuthenticationHandler object with the provided parameters
Declaration
Swift
public init(redirectURI: String)
Parameters
redirectURI
URI of the redirect used to indicate the browser-based Oauth2 authentication flow has completed successfully.
-
Not expected to be called from external consumers.
Subclasses may override this method to provide additional query parameters to the loadWebAuthenticationUrl sent to the
BrowserBasedAuthenticationHandlerDelegate
See also: BrowserBasedAuthenticationHandlerDelegate.authenticationHandler(, loadWebAuthenticationUrl: , shouldFollowRedirect:)
See also
BrowserBasedAuthenticationHandlerDelegate.authenticationHandler(, loadWebAuthenticationUrl: , shouldFollowRedirect:)Declaration
Swift
open func createAuthenticationLoginQueryItems() -> [URLQueryItem]
-
Not expected to be called from external consumers.
Subclasses may override this method to provide alternative query parameter parsing, or additional key/value pairs to the parsed query paremeters detected on the redirectURI following successful browser authentication.
from: URL containing query string parameters to parse
Declaration
Swift
open func parseAuthenticationRedirectQueryParameters(from url: URL) -> [String: String]
Return Value
key/value pairs from query string. If a query string key contains no value, a empty string will be the dictionary value. If the url contained no parameters, this an empty dictionary will be returned.
-
Not expected to be called from external consumers.
Subclasses may override this method to provide additional functionality prior to the authentication process.
Performs the online browser-based authentication process, calling the
authenticationBrowserDelegate
to display the authentication URL.Declaration
Swift
open override func performOnlineAuthentication()