SyncCredentials

public struct SyncCredentials

A SyncCredentials represents data that uniquely identifies a Realm Object Server user.

  • An account token serialized as a string

    Declaration

    Swift

    public typealias Token = String
  • Initialize new credentials using a custom token, authentication provider, and user information dictionary. In most cases, the convenience initializers should be used instead.

    Declaration

    Swift

    public init(customToken token: Token, provider: Provider, userInfo: [String : Any] = [:])
  • Initialize new credentials using a Facebook account token.

    Declaration

    Swift

    public static func facebook(token: Token) -> SyncCredentials
  • Initialize new credentials using a Google account token.

    Declaration

    Swift

    public static func google(token: Token) -> SyncCredentials
  • Initialize new credentials using a CloudKit account token.

    Declaration

    Swift

    public static func cloudKit(token: Token) -> SyncCredentials
  • Initialize new credentials using a Realm Object Server username and password.

    Declaration

    Swift

    public static func usernamePassword(username: String,
                                        password: String,
                                        register: Bool = false) -> SyncCredentials
  • Initialize new credentials using a Realm Object Server access token.

    Declaration

    Swift

    public static func accessToken(_ accessToken: String, identity: String) -> SyncCredentials
  • Initialize new credentials using a JSON Web Token.

    Declaration

    Swift

    public static func jwt(_ token: Token) -> SyncCredentials
  • Initialize new credentials using a nickname.

    Declaration

    Swift

    @available(*, deprecated, message: "Use usernamePassword instead.")
    public static func nickname(_ nickname: String, isAdmin: Bool = false) -> SyncCredentials
  • Initialize new credentials anonymously

    Declaration

    Swift

    public static func anonymous() -> SyncCredentials
  • Initialize new credentials using an externally-issued refresh token

    Declaration

    Swift

    public static func customRefreshToken(_ token: String, identity: String, isAdmin: Bool = false) -> SyncCredentials