SaaS CMS has officially launched! Learn more now.

Interface IRegistrar

Allows for self registering of users

Namespace: EPiServer.Commerce.Security
Assembly: EPiServer.Commerce.Security.dll
Version: 11.8.3
Syntax
public interface IRegistrar

Properties

AuthenticationType

Gets the type of the authentication. This should be the Authentication type that is used when registering with the IOwinContext

Declaration
string AuthenticationType { get; }
Property Value
Type Description
System.String

The type of the authentication.

Methods

ChangePassword(String, String, String)

Changes the password.

Declaration
bool ChangePassword(string userName, string oldPassword, string newPassword)
Parameters
Type Name Description
System.String userName

Name of the user.

System.String oldPassword

The old password.

System.String newPassword

The new password.

Returns
Type Description
System.Boolean

True if the password was succesfully changed.

CreateIdentity(String)

Creates the identity.

Declaration
ClaimsIdentity CreateIdentity(string userName)
Parameters
Type Name Description
System.String userName

Name of the user.

Returns
Type Description
System.Security.Claims.ClaimsIdentity

An System.Security.Claims.ClaimsIdentity for the username

CreateUser(String, String, String)

Creates the user.

Declaration
ClaimsPrincipal CreateUser(string userName, string password, string email)
Parameters
Type Name Description
System.String userName

Name of the user.

System.String password

The password.

System.String email

The email of the user.

Returns
Type Description
System.Security.Claims.ClaimsPrincipal

An System.Security.Principal.IPrincipal for the newly created user

DeleteUser(String)

Deletes the user.

Declaration
void DeleteUser(string userName)
Parameters
Type Name Description
System.String userName

Name of the user.

SignIn(AuthenticationProperties, ClaimsIdentity[])

Signs the user into the system.

Declaration
void SignIn(AuthenticationProperties properties, params ClaimsIdentity[] identities)
Parameters
Type Name Description
Microsoft.Owin.Security.AuthenticationProperties properties

Contains additional properties the middleware are expected to persist along with the claims. These values will be returned as the AuthenticateResult.properties collection when AuthenticateAsync is called on subsequent requests.

System.Security.Claims.ClaimsIdentity[] identities

Contains additional properties the middleware are expected to persist along with the claims. These values will be returned as the AuthenticateResult.properties collection when AuthenticateAsync is called on subsequent requests..

ValidateUser(String, String)

Validates the identity.

Declaration
bool ValidateUser(string userName, string password)
Parameters
Type Name Description
System.String userName

The username.

System.String password

The password.

Returns
Type Description
System.Boolean

True if the user was validated