Class UserController
- Namespace
- Oqtane.Controllers
- Assembly
- Oqtane.Server.dll
[Route("api/[controller]")]
public class UserController : Controller
- Inheritance
-
object
ControllerBase
Controller
UserController
Constructors
UserController(IUserRepository, ITenantManager, IUserManager, ISiteRepository, IUserPermissions, IJwtManager, IFileRepository, ISettingRepository, ILogManager)
public UserController(IUserRepository users, ITenantManager tenantManager, IUserManager userManager, ISiteRepository sites, IUserPermissions userPermissions, IJwtManager jwtManager, IFileRepository files, ISettingRepository settings, ILogManager logger)
Parameters
users
IUserRepository
tenantManager
ITenantManager
userManager
IUserManager
sites
ISiteRepository
userPermissions
IUserPermissions
jwtManager
IJwtManager
files
IFileRepository
settings
ISettingRepository
logger
ILogManager
Methods
Authenticate()
[HttpGet("authenticate")]
public User Authenticate()
Returns
- User
Delete(int, string)
[HttpDelete("{id}")]
[Authorize(Policy = "User:Write:Administrators")]
public Task Delete(int id, string siteid)
Parameters
id
int
siteid
string
Returns
- Task
Forgot(User)
[HttpPost("forgot")]
public Task Forgot(User user)
Parameters
user
User
Returns
- Task
Get(int, string)
[HttpGet("{id}")]
[Authorize]
public User Get(int id, string siteid)
Parameters
id
int
siteid
string
Returns
- User
Get(string, string)
[HttpGet("username/{username}")]
public User Get(string username, string siteid)
Parameters
username
string
siteid
string
Returns
- User
Get(string, string, string)
[HttpGet("search/{username}/{email}")]
public User Get(string username, string email, string siteid)
Parameters
username
string
email
string
siteid
string
Returns
- User
Import(string, string, string)
[HttpPost("import")]
[Authorize(Roles = "Administrators")]
public Task<Dictionary<string, string>> Import(string siteid, string fileid, string notify)
Parameters
siteid
string
fileid
string
notify
string
Returns
- Task<Dictionary<string, string>>
Link(User, string, string, string, string)
[HttpPost("link")]
public Task<User> Link(User user, string token, string type, string key, string name)
Parameters
user
User
token
string
type
string
key
string
name
string
Returns
- Task<User>
Login(User, bool, bool)
[HttpPost("login")]
public Task<User> Login(User user, bool setCookie, bool isPersistent)
Parameters
user
User
setCookie
bool
isPersistent
bool
Returns
- Task<User>
Logout(User)
[HttpPost("logout")]
[Authorize]
public Task Logout(User user)
Parameters
user
User
Returns
- Task
LogoutEverywhere(User)
[HttpPost("logouteverywhere")]
[Authorize]
public Task LogoutEverywhere(User user)
Parameters
user
User
Returns
- Task
PasswordRequirements(int)
[HttpGet("passwordrequirements/{siteid}")]
public Dictionary<string, string> PasswordRequirements(int siteid)
Parameters
siteid
int
Returns
- Dictionary<string, string>
PersonalAccessToken()
[HttpGet("personalaccesstoken")]
[Authorize(Roles = "Administrators")]
public string PersonalAccessToken()
Returns
- string
Post(User)
[HttpPost]
public Task<User> Post(User user)
Parameters
user
User
Returns
- Task<User>
Put(int, User)
[HttpPut("{id}")]
[Authorize]
public Task<User> Put(int id, User user)
Parameters
id
int
user
User
Returns
- Task<User>
Reset(User, string)
[HttpPost("reset")]
public Task<User> Reset(User user, string token)
Parameters
user
User
token
string
Returns
- Task<User>
Token()
[HttpGet("token")]
[Authorize(Roles = "Registered Users")]
public string Token()
Returns
- string
TwoFactor(User, string)
[HttpPost("twofactor")]
public User TwoFactor(User user, string token)
Parameters
user
User
token
string
Returns
- User
Validate(string)
[HttpGet("validate/{password}")]
public Task<bool> Validate(string password)
Parameters
password
string
Returns
- Task<bool>
ValidateUser(string, string, string)
[HttpGet("validateuser")]
public Task<UserValidateResult> ValidateUser(string username, string email, string password)
Parameters
username
string
email
string
password
string
Returns
- Task<UserValidateResult>
Verify(User, string)
[HttpPost("verify")]
public Task<User> Verify(User user, string token)
Parameters
user
User
token
string
Returns
- Task<User>