GeneratorJwtProvider

@objc(VSSGeneratorJwtProvider)
open class GeneratorJwtProvider : NSObject, AccessTokenProvider

Implementation of AccessTokenProvider which provides generated JWTs

  • JwtGeneretor for generating new tokens

    Declaration

    Swift

    @objc
    public let jwtGenerator: JwtGenerator
  • Identity that will be used for generating token if tokenContext do not have it (e.g. for read operations) WARNING: Do not create cards with defaultIdentity

    Declaration

    Swift

    @objc
    public let defaultIdentity: String
  • Additional data, that will be present in token

    Declaration

    Swift

    @objc
    public let additionalData: [String : String]?
  • Initializer

    Declaration

    Swift

    @objc
    public init(jwtGenerator: JwtGenerator, defaultIdentity: String, additionalData: [String : String]? = nil)

    Parameters

    jwtGenerator

    JwtGenerator instance for generating new tokens

    defaultIdentity

    Identity that will be used for generating token if tokenContext do not have it (e.g. for read operations) WARNING: Do not create cards with defaultIdentity

    additionalData

    Additional data, that will be present in token

  • Provides new generated JWT

    Declaration

    Swift

    public func getToken(with tokenContext: TokenContext, completion: @escaping (AccessToken?, Error?) -> Void)

    Parameters

    tokenContext

    TokenContext, provides context explaining why token is needed

    completion

    completion closure, called with access token or corresponding error