Package io.objectbox.sync
Class SyncCredentials
- java.lang.Object
-
- io.objectbox.sync.SyncCredentials
-
- Direct Known Subclasses:
SyncCredentialsToken
,SyncCredentialsUserPassword
public abstract class SyncCredentials extends java.lang.Object
Use the static helper methods to build Sync credentials, for exampleSyncCredentials.sharedSecret("secret")
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SyncCredentials.CredentialsType
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SyncCredentials.CredentialsType
getType()
long
getTypeId()
static SyncCredentials
google(java.lang.String idToken)
Authenticate with a Google account ID token obtained via Google Sign-In.static SyncCredentials
none()
No authentication, unsecured.static SyncCredentials
sharedSecret(byte[] secret)
Authenticate with a shared secret.static SyncCredentials
sharedSecret(java.lang.String secret)
Authenticate with a shared secret.static SyncCredentials
userAndPassword(java.lang.String user, java.lang.String password)
-
-
-
Method Detail
-
sharedSecret
public static SyncCredentials sharedSecret(java.lang.String secret)
Authenticate with a shared secret. This could be a passphrase, big number or randomly chosen bytes. The string is expected to use UTF-8 characters.
-
sharedSecret
public static SyncCredentials sharedSecret(byte[] secret)
Authenticate with a shared secret. This could be a passphrase, big number or randomly chosen bytes.
-
google
public static SyncCredentials google(java.lang.String idToken)
Authenticate with a Google account ID token obtained via Google Sign-In.
-
userAndPassword
public static SyncCredentials userAndPassword(java.lang.String user, java.lang.String password)
-
none
public static SyncCredentials none()
No authentication, unsecured. Use only for development and testing purposes.
-
getType
public SyncCredentials.CredentialsType getType()
-
getTypeId
public long getTypeId()
-
-