CallbackJwtProvider
@objc(VSSCallbackJwtProvider)
open class CallbackJwtProvider : NSObject, AccessTokenProvider
Implementation of AccessTokenProvider which provides AccessToken using callback
-
Callback, which takes a TokenContext and completion handler Completion handler should be called with either JWT, or Error
Declaration
Swift
@objc public let getJwtCallback: (TokenContext, @escaping (Jwt?, Error?) -> Void) -> Void
-
Initializer
Declaration
Swift
@objc public init(getJwtCallback: @escaping (TokenContext, @escaping (Jwt?, Error?) -> Void) -> Void)
Parameters
getJwtCallback
Callback, which takes a TokenContext and completion handler Completion handler should be called with either JWT, or Error
-
Typealias for callback used below
Declaration
Swift
public typealias JwtStringCallback = (String?, Error?) -> Void
-
Typealias for callback used below
Declaration
Swift
public typealias RenewJwtCallback = (TokenContext, @escaping JwtStringCallback) -> Void
-
Initializer
Declaration
Swift
@objc public convenience init(getTokenCallback: @escaping RenewJwtCallback)
Parameters
getTokenCallback
Callback, which takes a TokenContext and completion handler Completion handler should be called with either JWT string, or Error
-
Typealias for callback used below
Declaration
Swift
public typealias AccessTokenCallback = (AccessToken?, Error?) -> Void
-
Provides access token using callback
Declaration
Swift
public func getToken(with tokenContext: TokenContext, completion: @escaping AccessTokenCallback)
Parameters
tokenContext
TokenContext
provides context explaining why token is neededcompletion
completion closure