RLMSyncCredentials

@interface RLMSyncCredentials : NSObject

Opaque credentials representing a specific Realm Object Server user.

  • An opaque credentials token containing information that uniquely identifies a Realm Object Server user.

    Declaration

    Objective-C

    @property (readonly, nonatomic) RLMSyncCredentialsToken _Nonnull token;

    Swift

    var token: String { get }
  • The name of the identity provider which generated the credentials token.

    Declaration

    Objective-C

    @property (readonly, nonatomic) RLMIdentityProvider _Nonnull provider;

    Swift

    var provider: String { get }
  • A dictionary containing additional pertinent information. In most cases this is automatically configured.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSDictionary<NSString *, id> *_Nonnull userInfo;

    Swift

    var userInfo: [String : Any] { get }
  • Construct and return credentials from a Facebook account token.

    Declaration

    Objective-C

    + (nonnull instancetype)credentialsWithFacebookToken:
        (nonnull RLMSyncCredentialsToken)token;

    Swift

    convenience init(facebookToken token: String)
  • Construct and return credentials from a Google account token.

    Declaration

    Objective-C

    + (nonnull instancetype)credentialsWithGoogleToken:
        (nonnull RLMSyncCredentialsToken)token;

    Swift

    convenience init(googleToken token: String)
  • Construct and return credentials from an iCloud account token.

    Declaration

    Objective-C

    + (nonnull instancetype)credentialsWithICloudToken:
        (nonnull RLMSyncCredentialsToken)token;

    Swift

    convenience init(iCloudToken token: String)
  • Construct and return credentials from a Realm Object Server username and password.

    Declaration

    Objective-C

    + (nonnull instancetype)credentialsWithUsername:(nonnull NSString *)username
                                           password:(nonnull NSString *)password
                                           register:(BOOL)shouldRegister;

    Swift

    convenience init(username: String, password: String, register shouldRegister: Bool)
  • Construct and return special credentials representing a token that can be directly used to open a Realm. The identity is used to uniquely identify the user across application launches.

    Declaration

    Objective-C

    + (nonnull instancetype)credentialsWithAccessToken:
                                (nonnull RLMServerToken)accessToken
                                              identity:(nonnull NSString *)identity;

    Swift

    convenience init(accessToken: String, identity: String)
  • Construct and return credentials with a custom token string, identity provider string, and optional user info. In most cases, the convenience initializers should be used instead.

    Declaration

    Objective-C

    - (nonnull instancetype)
    initWithCustomToken:(nonnull RLMSyncCredentialsToken)token
               provider:(nonnull RLMIdentityProvider)provider
               userInfo:(nullable NSDictionary *)userInfo;

    Swift

    init(customToken token: String, provider: String, userInfo: [AnyHashable : Any]? = nil)