Show / Hide Table of Contents

Class SoPasswordCredentialPlugin

Inheritance
object
SoPasswordCredentialPlugin
Implements
IUserCredentialPlugin
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: SuperOffice.CRM.Administration
Assembly: SoDataBase.BusinessLogic.dll
Syntax
[UserCredentialPlugin("CRM5/PASSWORD")]
public class SoPasswordCredentialPlugin : IUserCredentialPlugin

Constructors

SoPasswordCredentialPlugin()

Declaration
public SoPasswordCredentialPlugin()

Properties

CanCreatePerson

Can the plugin create a person (that can be the bases for a user)

Declaration
public bool CanCreatePerson { get; }
Property Value
Type Description
bool

ControlType

Type of control used to display the value.

Declaration
public CredentialControlType ControlType { get; }
Property Value
Type Description
CredentialControlType

Description

Description of the authentication type. This value is used in a list of authentication providers that can be choosen by an end user and should be a fairly describtive text. This will typically be SuperOffice is responsible for username and password for a password scenario.

Declaration
public string Description { get; }
Property Value
Type Description
string

DisplayType

The name of the credentials to be displayed in the user interface.
This will typically be Password for user-name/password scenarios and Active Directoru User for AD integration.

Declaration
public string DisplayType { get; }
Property Value
Type Description
string

IsUserNameSupported

Does this plugin support the associate user name field?

Declaration
public bool IsUserNameSupported { get; }
Property Value
Type Description
bool

Methods

AddDefaultCredentialsToUserAsync(SoUser, CancellationToken)

Declaration
public Task AddDefaultCredentialsToUserAsync(SoUser user, CancellationToken cancellationToken = default)
Parameters
Type Name Description
SoUser user
CancellationToken cancellationToken
Returns
Type Description
Task

CanChangePasswordAsync(CredentialsRow, CancellationToken)

Is this plugin able to change password for the current credential

Declaration
public Task<bool> CanChangePasswordAsync(CredentialsRow row, CancellationToken cancellationToken = default)
Parameters
Type Name Description
CredentialsRow row

Information about the credential.

CancellationToken cancellationToken
Returns
Type Description
Task<bool>
Remarks

True if the plugin is able to change password.

CanHandle(UserType)

Check if the plugin can handle credentials for SuperOffice.License.UserType.

Declaration
public bool CanHandle(UserType userType)
Parameters
Type Name Description
UserType userType
Returns
Type Description
bool

True if the plugin can handle the userType

CanValidatePassword(CredentialsRow)

Is the plugin able to validfate the password.

Declaration
public bool CanValidatePassword(CredentialsRow row)
Parameters
Type Name Description
CredentialsRow row

Information about the credential.

Returns
Type Description
bool

True if it is possible to validate the password.

ChangePassword(CredentialsRow, string, string)

Changes the account password from the old password to the new password.

Declaration
public void ChangePassword(CredentialsRow row, string oldPassword, string newPassword)
Parameters
Type Name Description
CredentialsRow row

Information about the credential.

string oldPassword

The old password to change from. This must be the current calid password.

string newPassword

The new password to change to.

CreatePersonAsync(int, string, string, CancellationToken)

Create Person and return person id of the person created

Declaration
public Task<Person> CreatePersonAsync(int contactId, string value, string displayValue, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int contactId

Contact id for the person to create.

string value

This is the actuall value of the credentials. This will typically be the password or teh users SID in active directory.

string displayValue

The value displayed to the user. this will typically be the users login name in active directory.

CancellationToken cancellationToken
Returns
Type Description
Task<Person>

Primary key of the person created

FindCredentialUsersAsync(string, CancellationToken)

Find users mathcing the partial name.

Declaration
public Task<UserCredentialList> FindCredentialUsersAsync(string searchString, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string searchString

Partly name of the user group

CancellationToken cancellationToken
Returns
Type Description
Task<UserCredentialList>

FindGroups(string)

Get user groups holding users. This method is only relevant if the CredentialType control is of type link. There will allways be at least one groups even if the underlying provider does not support groups.

Declaration
public UserCredentialGroup[] FindGroups(string searchString)
Parameters
Type Name Description
string searchString

Partly name of domain group.

Returns
Type Description
UserCredentialGroup[]

GetCredentialUsersInGroupAsync(string, CancellationToken)

Get credential users within a user group

Declaration
public Task<UserCredentialList> GetCredentialUsersInGroupAsync(string groupName, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string groupName

Name of user group needed to discover the users.

CancellationToken cancellationToken
Returns
Type Description
Task<UserCredentialList>

GetDefaultPriority(UserType, int)

Get default priority for plugin. Highest number will be the default plugin. Password will by default be 0 as a base-line

Declaration
public int GetDefaultPriority(UserType userType, int personId)
Parameters
Type Name Description
UserType userType

Type of user

int personId

PersonId if the user type is a person

Returns
Type Description
int

GetDisplayValue(CredentialsRow)

Get the display value of the user.

Declaration
public string GetDisplayValue(CredentialsRow row)
Parameters
Type Name Description
CredentialsRow row

The credential row to get the value from.

Returns
Type Description
string

The value displayed to the user. this will typically be the users login name in active directory.

GetSupportedChangePasswordTypesAsync(CredentialsRow, CancellationToken)

Returns a list of the types of password changes that is allowed for this credential. Returns empty array if no type is supported.

Declaration
public Task<ChangePasswordType[]> GetSupportedChangePasswordTypesAsync(CredentialsRow row, CancellationToken cancellationToken = default)
Parameters
Type Name Description
CredentialsRow row
CancellationToken cancellationToken
Returns
Type Description
Task<ChangePasswordType[]>

GetValue(CredentialsRow)

Get value (key) to the user in the foreign system. This can also be the password.

Declaration
public string GetValue(CredentialsRow row)
Parameters
Type Name Description
CredentialsRow row

The credential row to get the value from.

Returns
Type Description
string

This is the actuall value of the credentials. This will typically be the password or teh users SID in active directory.

IsPasswordLegal(SoUser, string, out string)

Check if a password is legal meaning it comply with the configured password policy for this provider. Implementations must return true if there is no policy checks to be done.

Declaration
public bool IsPasswordLegal(SoUser user, string password, out string reason)
Parameters
Type Name Description
SoUser user
string password
string reason
Returns
Type Description
bool

IsPasswordValid(CredentialsRow, string)

Check if password is valid.

Declaration
public bool IsPasswordValid(CredentialsRow row, string password)
Parameters
Type Name Description
CredentialsRow row

Information about the credential.

string password

The password to check if if it is valid (e.g. that means that this is the current password.)

Returns
Type Description
bool

True if the right password is passed in.

SendChangePasswordEmailAsync(CredentialsRow)

Send an email the user cna use to change password.

Declaration
public Task SendChangePasswordEmailAsync(CredentialsRow row)
Parameters
Type Name Description
CredentialsRow row
Returns
Type Description
Task

UpdateCredentialsRow(CredentialsRow, string, string, string)

Update credential row.

Declaration
public void UpdateCredentialsRow(CredentialsRow row, string associateName, string value, string displayValue)
Parameters
Type Name Description
CredentialsRow row

The credentials row to apply the values on.

string associateName

SuperOffice user-name of the user.

string value

This is the actuall value of the credentials. This will typically be the password or teh users SID in active directory.

string displayValue

The value displayed to the user. this will typically be the users login name in active directory.

Implements

IUserCredentialPlugin

Extension Methods

EnumUtil.MapEnums<From, To>(From)
Converters.MapEnums<From, To>(From)
ObjectExtensions.AssignByReflection<T>(T, T)
ObjectExtensions.GraphCopy<T>(T)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top