🚀 Welcome to MDriven Learn –  Don’t miss the latest Release Notes.
SysUserAuthentication

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).

SysUserAuthentication Pattern

The Pattern supports external login using Google, Open ID, Microsoft, and Facebook. Check here for details on how to log in 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 a user's password is reset or a user adds an external login.

SendMeNews: Boolean?

Boolean for subscribing to the newsletter.

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

  1. Merge the pattern into your model from TK Live View