UAACodeExchangeAuthenticationHandler
public class UAACodeExchangeAuthenticationHandler: AuthenticationHandler
A specialized AuthenticationHandler that works with an associated BrowserBasedAuthenticationHandler
to exchange a UAA authorization code for authentication and refresh tokens.
-
Response payload from the associated
BrowserBasedAuthenticationHandler
Declaration
Swift
override public var authenticationResponsePayload: [String: Any]
-
URLSessionConfiguration
to use for the authentication request. Defaults to URLSessionConfiguration.default.Declaration
Swift
public var sessionConfiguration = URLSessionConfiguration.default
-
Response status code expected from the server if the authentication request was successful.
Declaration
Swift
public var serviceCallSucceededResponseCode = Http.StatusCode.ok
-
Response status code expected from the server if the authentication request was unsuccessful.
Declaration
Swift
public var serviceCallFailedResponseCode = Http.StatusCode.unauthorized
-
The AuthenticationManager associated with this
UAACodeExchangeAuthenticationHandler
Declaration
Swift
public override weak var manager: AuthenticationManager?
-
UAA Path to call to exchange an Authorization Code for access and refresh tokens
Declaration
Swift
public var codeExchangeURLPath = "/oauth/token"
-
Convenience reference to manager’s configuration clientId value. Equal to self.manager?.configuration.clientId
Declaration
Swift
public var clientId: String?
-
Convenience reference to manager’s configuration clientSecret value Equal to self.manager?.configuration.clientSecret
Declaration
Swift
public var clientSecret: String?
-
Request headers to add to the authentication request
Declaration
Swift
public var requestHeaders: [String: String] = [:]
-
The body encoding to use in the authentication request
See also: RequestBodyEncoding
-SeeAlso: RequestBodyEncoding
Declaration
Swift
public var requestBodyEncoding: RequestBodyEncoding
-
Initializes and returns a UAACodeExchangeAuthenticationHandler object
Declaration
Swift
public required init(handler: BrowserBasedAuthenticationHandler, code: String)
Parameters
handler
related BrowserBasedAuthenticationHandler peforming initial
authorization code grant
type authentication.code
authorization code retrieved during associated
BrowserBasedAuthenticationHandler
authentication. This code will be exchanged for authentication and refresh tokens.
-
Declaration
Swift
open override func cancelAuthentication()
-
Starts the authentication code-exchange process.
Called by the associated
BrowserBasedAuthenticationHandler
when needed.- completionHandler: closure called when authentication has completed.
- result: AuthenticateResult: Success or fail, result of authentication.
Declaration
Swift
override public func authenticate(completionHandler: @escaping (AuthenticateResult) -> Void)