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;
  • The name of the identity provider which generated the credentials token.

    Declaration

    Objective-C

    @property (readonly, nonatomic) RLMIdentityProvider _Nonnull provider;
  • A dictionary containing additional pertinent information. In most cases this is automatically configured.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSDictionary<NSString *, id> *_Nonnull userInfo;
  • Construct and return credentials from a Facebook account token.

    Declaration

    Objective-C

    + (nonnull instancetype)credentialsWithFacebookToken:
        (nonnull RLMSyncCredentialsToken)token;
  • Construct and return credentials from a Google account token.

    Declaration

    Objective-C

    + (nonnull instancetype)credentialsWithGoogleToken:
        (nonnull RLMSyncCredentialsToken)token;
  • Construct and return credentials from an CloudKit account token.

    Declaration

    Objective-C

    + (nonnull instancetype)credentialsWithCloudKitToken:
        (nonnull RLMSyncCredentialsToken)token;
  • 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;
  • 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.

    Warning

    The custom user identity will be deprecated in a future release.

    Warning

    Do not specify a user identity that is the URL of an authentication server.

    Warning

    When passing an access token credential into any of RLMSyncUser‘s login methods, you must always specify the same authentication server URL, or none at all, every time you call the login method.

    Declaration

    Objective-C

    + (nonnull instancetype)credentialsWithAccessToken:
                                (nonnull RLMServerToken)accessToken
                                              identity:(nonnull NSString *)identity;
  • 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;