Interface IGotrueAdminClient<TUser>
- Namespace
- Supabase.Gotrue.Interfaces
- Assembly
- Supabase.Gotrue.dll
Interface for the Gotrue Admin Client (auth).
public interface IGotrueAdminClient<TUser> : IGettableHeaders where TUser : User
Type Parameters
TUser
- Inherited Members
-
IGettableHeaders.GetHeaders
Methods
CreateUser(AdminUserAttributes)
Creates a user using the admin key (not the anonymous key). Used in trusted server environments, not client apps.
Task<TUser?> CreateUser(AdminUserAttributes attributes)
Parameters
attributes
AdminUserAttributes
Returns
- Task<TUser>
CreateUser(string, string, AdminUserAttributes?)
Creates a user using the admin key (not the anonymous key). Used in trusted server environments, not client apps.
Task<TUser?> CreateUser(string email, string password, AdminUserAttributes? attributes = null)
Parameters
email
stringpassword
stringattributes
AdminUserAttributes
Returns
- Task<TUser>
DeleteFactor(MfaAdminDeleteFactorParams)
Deletes a factor on a user. This will log the user out of all active sessions if the deleted factor was verified.
Task<MfaAdminDeleteFactorResponse?> DeleteFactor(MfaAdminDeleteFactorParams deleteFactorParams)
Parameters
deleteFactorParams
MfaAdminDeleteFactorParams
Returns
- Task<MfaAdminDeleteFactorResponse>
A MfaAdminDeleteFactorResponse containing the deleted factor id.
DeleteUser(string)
Creates a user using the admin key (not the anonymous key). Used in trusted server environments, not client apps.
Task<bool> DeleteUser(string uid)
Parameters
uid
string
Returns
GenerateLink(GenerateLinkOptions)
Generates email links and OTPs to be sent via a custom email provider.
Task<GenerateLinkResponse?> GenerateLink(GenerateLinkOptions options)
Parameters
options
GenerateLinkOptionsOptions for this call.
Password
is required for SignUp,Data
is an optional parameter for SignUp.
Returns
GetUser(string)
Gets a user from a user's JWT. This is using the GoTrue server to validate a user's JWT.
Task<TUser?> GetUser(string jwt)
Parameters
jwt
string
Returns
- Task<TUser>
GetUserById(string)
Gets a user by ID from the server using the admin key (not the anonymous key).
Task<TUser?> GetUserById(string userId)
Parameters
userId
string
Returns
- Task<TUser>
InviteUserByEmail(string, InviteUserByEmailOptions?)
Sends an email to the user.
Task<bool> InviteUserByEmail(string email, InviteUserByEmailOptions? options = null)
Parameters
email
stringoptions
InviteUserByEmailOptions
Returns
ListFactors(MfaAdminListFactorsParams)
Lists all factors associated to a specific user.
Task<MfaAdminListFactorsResponse?> ListFactors(MfaAdminListFactorsParams listFactorsParams)
Parameters
listFactorsParams
MfaAdminListFactorsParams
Returns
- Task<MfaAdminListFactorsResponse>
A list of Factor that this user has enabled.
ListUsers(string?, string?, SortOrder, int?, int?)
Lists users
Task<UserList<TUser>?> ListUsers(string? filter = null, string? sortBy = null, Constants.SortOrder sortOrder = SortOrder.Descending, int? page = null, int? perPage = null)
Parameters
filter
stringA string for example part of the email
sortBy
stringSnake case string of the given key, currently only created_at is supported
sortOrder
Constants.SortOrderasc or desc, if null desc is used
page
int?page to show for pagination
perPage
int?items per page for pagination
Returns
Update(UserAttributes)
Updates a User using the service key
Task<User?> Update(UserAttributes attributes)
Parameters
attributes
UserAttributes
Returns
UpdateUserById(string, AdminUserAttributes)
Update user by Id
Task<User?> UpdateUserById(string userId, AdminUserAttributes userData)
Parameters
userId
stringuserData
AdminUserAttributes