BeamsTokenProvider

@objc
public final class BeamsTokenProvider : NSObject, TokenProvider

Used to generate tokens for users to authenticate against.

  • The authentication endpoint URL String.

    Declaration

    Swift

    public let authURL: String
  • A closure that returns an AuthData object.

    Declaration

    Swift

    public let getAuthData: () -> AuthData
  • Creates a BeamsTokenProvider instance.

    Declaration

    Swift

    @objc
    public init(authURL: String, getAuthData: @escaping () -> (AuthData))

    Parameters

    authURL

    The authentication endpoint URL String.

    getAuthData

    A closure that returns an AuthData object.

  • Fetch a token for a given user to authenticate against.

    Declaration

    Swift

    public func fetchToken(userId: String, completionHandler completion: @escaping (String, Error?) -> Void) throws

    Parameters

    userId

    The user ID String.

    completion

    A closure containing a valid token String or an Error.