JWTAuthenticator

public class JWTAuthenticator : Authenticator

A JSON Web Token (JWT) based authentication strategy is to be used to authenticate a guest user on Cisco Webex.

Since

1.2.0
  • Since

    1.2.0

    Declaration

    Swift

    public var authorized: Bool { get }
  • Returns the expiration of the access token

    Since

    2.3.0

    Declaration

    Swift

    public var expiration: Date? { get }
  • Creates a new JWT authentication strategy

    Since

    1.2.0

    Declaration

    Swift

    public init()
  • Sets the JWT access token on the authorization strategy, overriting any existing access token.

    Since

    1.2.0

    Declaration

    Swift

    public func authorizedWith(jwt: String, completionHandler: @escaping (_ result: Result<Bool>) -> Void)

    Parameters

    jwt

    The new JSON Web Token to use. JWT should contain the exp field to pass validation

    completionHandler

    The completionHandler that is invoked after authorization with a success boolean

  • See

    See Authenticator.deauthorize() After this method has been invoked, for continued usage, new instances of JWTAuthenticator and Webex need to be created and used

    Since

    1.2.0

    Declaration

    Swift

    public func deauthorize(completionHandler: (() -> Void)?)
  • See

    See Authenticator.accessToken(completionHandler:)

    Since

    1.2.0

    Declaration

    Swift

    public func accessToken(completionHandler: @escaping (_ token: (Result<String>)) -> Void)
  • Refresh the access token.

    Since

    1.4.0

    Declaration

    Swift

    public func refreshToken(completionHandler: @escaping (Result<String>) -> Void)

    Parameters

    completionHandler

    a closure to be executed when completed, with the new access token if successfully retrieved, otherwise nil.