.SignUp()
Signs up to a specific authentication scope / access method.
Method Syntax
await db.SignUp(credentials)
Arguments
| Arguments | Description |
|---|
credentials required | Credentials to sign up as a scoped user. |
cancellationToken optional | The cancellationToken enables graceful cancellation of asynchronous operations. |
Example usage
var authParams = new AuthParams
{
Namespace = "test",
Database = "test",
Access = "user",
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; }
}
var authParams = new AuthParams
{
Namespace = "test",
Database = "test",
Scope = "user",
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.