C# Class GSF.Security.LdapSecurityProvider

Represents an ISecurityProvider that uses Active Directory for its backend data store and credential authentication.
A Security Identifier can also be specified in IncludedResources instead of a role name in the format of 'SID:<Security Identifier>' (Example: SID:S-1-5-21-19610888-1443184010-1631745340-269783).
Inheritance: SecurityProviderBase
Show file Open project: GridProtectionAlliance/gsf

Public Methods

Method Description
Authenticate ( string password ) : bool

Authenticates the user.

ChangePassword ( string oldPassword, string newPassword ) : bool

Changes user password in the backend data store.

This method always returns false under Mono deployments.

LdapSecurityProvider ( string username ) : System

Initializes a new instance of the LdapSecurityProvider class.

LoadSettings ( ) : void

Loads saved LdapSecurityProvider settings from the config file if the SecurityProviderBase.PersistSettings property is set to true.

RefreshData ( ) : bool

Refreshes the UserData from the backend data store.

ResetPassword ( string securityAnswer ) : bool

Resets user password in the backend data store.

SaveSettings ( ) : void

Saves LdapSecurityProvider settings to the config file if the SecurityProviderBase.PersistSettings property is set to true.

TranslateRole ( string role ) : string

Performs a translation of the specified user role.

UpdateData ( ) : bool

Updates the UserData in the backend data store.

Protected Methods

Method Description
GetLdapPath ( ) : string

Gets the LDAP path.

LdapSecurityProvider ( string username, bool canRefreshData, bool canUpdateData, bool canResetPassword, bool canChangePassword ) : System

Initializes a new instance of the LdapSecurityProvider class.

RefreshData ( List groupCollection, int providerID ) : bool

Refreshes the UserData from the backend data store loading user groups into desired collection.

Method Details

Authenticate() public method

Authenticates the user.
public Authenticate ( string password ) : bool
password string Password to be used for authentication.
return bool

ChangePassword() public method

Changes user password in the backend data store.
This method always returns false under Mono deployments.
public ChangePassword ( string oldPassword, string newPassword ) : bool
oldPassword string User's current password.
newPassword string User's new password.
return bool

GetLdapPath() protected method

Gets the LDAP path.
protected GetLdapPath ( ) : string
return string

LdapSecurityProvider() public method

Initializes a new instance of the LdapSecurityProvider class.
public LdapSecurityProvider ( string username ) : System
username string Name that uniquely identifies the user.
return System

LdapSecurityProvider() protected method

Initializes a new instance of the LdapSecurityProvider class.
protected LdapSecurityProvider ( string username, bool canRefreshData, bool canUpdateData, bool canResetPassword, bool canChangePassword ) : System
username string Name that uniquely identifies the user.
canRefreshData bool true if the security provider can refresh from the backend data store, otherwise false.
canUpdateData bool true if the security provider can update in the backend data store, otherwise false.
canResetPassword bool true if the security provider can reset user password, otherwise false.
canChangePassword bool true if the security provider can change user password, otherwise false.
return System

LoadSettings() public method

Loads saved LdapSecurityProvider settings from the config file if the SecurityProviderBase.PersistSettings property is set to true.
public LoadSettings ( ) : void
return void

RefreshData() public method

Refreshes the UserData from the backend data store.
public RefreshData ( ) : bool
return bool

RefreshData() protected method

Refreshes the UserData from the backend data store loading user groups into desired collection.
protected RefreshData ( List groupCollection, int providerID ) : bool
groupCollection List Target collection for user groups.
providerID int Unique provider ID used to distinguish cached user data that may be different based on provider.
return bool

ResetPassword() public method

Resets user password in the backend data store.
Always
public ResetPassword ( string securityAnswer ) : bool
securityAnswer string Answer to the user's security question.
return bool

SaveSettings() public method

Saves LdapSecurityProvider settings to the config file if the SecurityProviderBase.PersistSettings property is set to true.
public SaveSettings ( ) : void
return void

TranslateRole() public method

Performs a translation of the specified user role.
public TranslateRole ( string role ) : string
role string The user role to be translated.
return string

UpdateData() public method

Updates the UserData in the backend data store.
Always
public UpdateData ( ) : bool
return bool