Package io.objectbox.sync
Class SyncCredentials
java.lang.Object
io.objectbox.sync.SyncCredentials
- Direct Known Subclasses:
SyncCredentialsToken,SyncCredentialsUserPassword
Use the static helper methods to build Sync credentials,
for example
SyncCredentials.sharedSecret("secret").-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) abstract SyncCredentialsCreates a copy of these credentials.getType()longstatic SyncCredentialsAuthenticate with a Google account ID token obtained via Google Sign-In.static SyncCredentialsjwtAccessToken(String jwtAccessToken) JSON Web Token (JWT): an access token that is used to access resources.static SyncCredentialsjwtCustomToken(String jwtCustomToken) JSON Web Token (JWT): a token that is neither an ID, access, nor refresh token.static SyncCredentialsjwtIdToken(String jwtIdToken) JSON Web Token (JWT): an ID token that typically provides identity information about the authenticated user.static SyncCredentialsjwtRefreshToken(String jwtRefreshToken) JSON Web Token (JWT): a refresh token that is used to obtain a new access token.static SyncCredentialsnone()No authentication, unsecured.static SyncCredentialsobxAdminUser(String user, String password) ObjectBox admin users (username/password)static SyncCredentialssharedSecret(byte[] secret) Authenticate with a shared secret.static SyncCredentialssharedSecret(String secret) Authenticate with a shared secret.static SyncCredentialsuserAndPassword(String user, String password) Generic credential type suitable for ObjectBox admin (and possibly others in the future)
-
Field Details
-
type
-
-
Constructor Details
-
SyncCredentials
SyncCredentials(SyncCredentials.CredentialsType type)
-
-
Method Details
-
google
Authenticate with a Google account ID token obtained via Google Sign-In. -
obxAdminUser
ObjectBox admin users (username/password) -
userAndPassword
Generic credential type suitable for ObjectBox admin (and possibly others in the future) -
jwtIdToken
JSON Web Token (JWT): an ID token that typically provides identity information about the authenticated user. -
jwtAccessToken
JSON Web Token (JWT): an access token that is used to access resources. -
jwtRefreshToken
JSON Web Token (JWT): a refresh token that is used to obtain a new access token. -
jwtCustomToken
JSON Web Token (JWT): a token that is neither an ID, access, nor refresh token. -
none
No authentication, unsecured. Use only for development and testing purposes. -
getType
-
getTypeId
public long getTypeId() -
createClone
Creates a copy of these credentials.This can be useful to use the same credentials when creating multiple clients or a server in combination with a client as some credentials may get cleared when building a client or server.