• Start

Methods

SignUp

The .NET SDK for SurrealDB enables simple and advanced querying of a remote or embedded database.

Signs up to a specific authentication scope / access method.

Method Syntax
await db.SignUp(credentials)

Arguments

Description

credentials

Credentials to sign up as a scoped user.

cancellationToken

The cancellationToken enables graceful cancellation of asynchronous operations.

// With Record Access
var authParams = new AuthParams
{
    Namespace = "main",
    Database = "main",
    Access = "user",
	// Also pass any properties required by the access definition
    Email = "info@surrealdb.com",
    Password = "123456"
};

Jwt jwt = await db.SignUp(authParams);

public class AuthParams : ScopeAuth
{
	public string? Username { get; set; }
	public string? Email { get; set; }
	public string? Password { get; set; }
}

You can invalidate the authentication for the current connection using the Invalidate() method.

Was this page helpful?