Class RecordCredential

java.lang.Object
com.surrealdb.signin.RecordCredential
All Implemented Interfaces:
Credential

public class RecordCredential extends Object implements Credential
Credentials for signing up or signing in as a record user (record access method). Used with Surreal.signup(RecordCredential) and Surreal.signin(Credential).

When namespace or database are null, the SDK uses the current session namespace/database set via Surreal.useNs(String) and Surreal.useDb(String) (or the values returned by Surreal.useNs(String) etc.). Call those first when omitting ns/db.

The params object is serialized and sent as the signup/signin variables (e.g. email, password). It must be a type that can be converted to a SurrealDB value (e.g. Map, POJO, or primitive). May be null; null is sent as SurrealDB null.

  • Constructor Details

    • RecordCredential

      public RecordCredential(String namespace, String database, String access, Object params)
      Creates record credentials with explicit namespace and database.
      Parameters:
      namespace - namespace name (may be null to use session default)
      database - database name (may be null to use session default)
      access - access method name (as defined in DEFINE ACCESS)
      params - signup/signin variables (e.g. map with "email", "password"); will be serialized
    • RecordCredential

      public RecordCredential(String access, Object params)
      Creates record credentials using the current session namespace and database. Requires Surreal.useNs(String) and Surreal.useDb(String) (or Surreal.useDefaults()) to have been called first.
      Parameters:
      access - access method name (as defined in DEFINE ACCESS)
      params - signup/signin variables (e.g. map with "email", "password"); will be serialized
  • Method Details

    • getNamespace

      public String getNamespace()
    • getDatabase

      public String getDatabase()
    • getAccess

      public String getAccess()
    • getParams

      public Object getParams()