OAuthAuthenticator
public class OAuthAuthenticator : Authenticator
An OAuth based authentication strategy for authenticating a user on Cisco Spark.
Since
1.2.0-
The delegate, which gets callbacks for refresh access token failure
Declaration
Swift
public weak var delegate: OAuthAuthenticatorDelegate? -
See
See Authenticator.authorizedSince
1.2.0Declaration
Swift
public var authorized: Bool { get } -
Declaration
Swift
public convenience init(clientId: String, clientSecret: String, scope: String, redirectUri: String, storage: OAuthStorage = OAuthKeychainStorage())Parameters
clientIdthe OAuth client id
clientSecretthe OAuth client secret
scopespace-separated string representing which permissions the application needs
redirectUrithe redirect URI that will be called when completing the authentication. This must match the redirect URI registered to your clientId.
storagethe storage mechanism for persisting authentication information
-
Brings up a web-based authorization view controller and directs the user through the OAuth process.
Since
1.2.0Declaration
Swift
public func authorize(parentViewController: UIViewController, completionHandler: ((_ success: Bool) -> Void)? = nil)Parameters
parentViewControllerthe parent view controller for the OAuth view controller
completionHandlerthe completion handler will be called when authentication is complete, with a boolean to indicate if the authentication process was successful. It will be called directly after the OAuth view controller has begun to dismiss itself in an animated way.
-
See
See Authenticator.accessToken(completionHandler:)Since
1.2.0Declaration
Swift
public func accessToken(completionHandler: @escaping (String?) -> Void) -
See
See Authenticator.refreshToken(completionHandler:)Since
1.4.0Declaration
Swift
public func refreshToken(completionHandler: @escaping (String?) -> Void) -
See
See Authenticator.deauthorize()Since
1.2.0Declaration
Swift
public func deauthorize()
View on GitHub
OAuthAuthenticator Class Reference