The SysUserAuthentication model pattern is for integrating user registration and login into your Turnkey App.
This pattern uses the ASP.NET Core Identity architecture to add user registration and sign-in. It handles both authentication (who you are) and authorization (what you are permitted to do).
The Pattern supports external login using Google, Open ID, Microsoft, Facebook. Check here for details on how to login with third party providers.
SysUser
Attributes
isAdmin
: Boolean?
Boolean for specifying that a user has administrator permissions.
PasswordHash
: String?
Password hash
SecurityStamp
: String?
Invalidates sessions and cookies when user password is reset or user adds an external login.
SendMeNews
: Boolean?
Boolean for subscribing to news letter
UserName
: String
Unique user name.
Methods
HashPassword
: String
Argument: pwd:String - password to hash
Returns: String - password hash
This method is used to set a new User password using hashing.
SetPassword
Arg: pwd:String - new password to set
This method is used to set a new PasswordHash for a user using the HashPassword method.
self.PasswordHash:=self.HashPassword(pwd)
SysExternalLogin
This Class is for handling the third party login for example logging in with Google, Microsoft or Facebook.
SysRole
This Class is for adding user roles. These can be used with access groups to set ViewModel permissions for different user groups.
How To Use SysUserAuthentication Pattern
- Merge the pattern into your model from TK Live View