FuseGuard Logo

fuseguard.components.authenticators
Component DBAuthenticator

authenticators.BaseAuthenticator
  |
  +--authenticators.DBAuthenticator

Authenticates against the fuseguard database tables fuseguard_users

Method Summary
public any init([any firewallInstance])
          Initialize the Authenticator on firewall configure.
package void auditUserEvent([string user_id="0"], string event_type, string event_description)
          I log a user action
public boolean authenticate(string username, string password)
          I authenticate a user credential
public boolean authenticateByToken([string auth_token="#getAuthenticationCookieValue()#"])
public boolean canEditUsers()
          Returns true if this Authenticator supports the methods to edit users and change passwords
public void changePassword(string user_id, string old_password, string new_password, string confirm_password)
          Used to change a users password
package string createAuthenticationToken([string user_id], [string password_hash], [string token])
package string generateForgotPasswordToken([any user_id])
public query getAllUsers()
          Returns a list of all users
package numeric getAuditEventFrequency(string event_type, [string user_id="0"], [string ip_address=""])
          returns the number of times the event was logged in the past hour
public string getDescription()
          Returns a description of where the data is stored, eg datasource name.
public query getUserByEmail([any email])
          Returns user info query by email address
public query getUserByID([any user_id])
public boolean reAuthorizePassword([string password], [any user_id="#getAuthenticatedUserID()#"])
          Allows for reAuthorization via password for sensitive operations.
public void setDatasource(any datasource, [any username=""], [any password=""], [any dbtype=""])
          Sets the datasource name.
public string updateUser([string user_id], [struct user])
          Updates or creates a user by passing in a struct with keys email, roles, enabled, etc. Performs security checks to make sure the current user may perform this action as well. Returns the user id of the new or existing user.
package boolean verifyForgotPasswordToken([any user_id], [any token])

Methods inherited from authenticators.BaseAuthenticator
getMinimumPasswordLength, setIsAuthenticated, generateHash, getAuthenticatedUserToken, setHashAlgorithm, getAuthenticatedUserID, getAuthenticationCookieValue, generateToken, isAuthenticatedUserAdmin, changeForgotPassword, getAuthenticatedUserRoles, setWorkFactor, getKeySize, getDefaultHashAlgorithm, setAuthenticationCookie, isUserAuthenticated, setKeySize, getHashAlgorithm, isAuthenticatedUserInRole, logout, verifyHash, getTokenType, constantTimeCompare, setMinimumPasswordLength, getWorkFactor, deleteAuthenticationCookie, sendForgotPasswordEmail, isPasswordValid
 

Method Detail

auditUserEvent

package void auditUserEvent([string user_id="0"], string event_type, string event_description)
I log a user action

Parameters:
[string user_id="0"]
string event_type
string event_description

authenticate

public boolean authenticate(string username, string password)
I authenticate a user credential

Parameters:
string username
string password

authenticateByToken

public boolean authenticateByToken([string auth_token="#getAuthenticationCookieValue()#"])
Parameters:
[string auth_token="#getAuthenticationCookieValue()#"]

canEditUsers

public boolean canEditUsers()
Returns true if this Authenticator supports the methods to edit users and change passwords


changePassword

public void changePassword(string user_id, string old_password, string new_password, string confirm_password)
Used to change a users password

Parameters:
string user_id
string old_password
string new_password
string confirm_password

createAuthenticationToken

package string createAuthenticationToken([string user_id], [string password_hash], [string token])
Parameters:
[string user_id]
[string password_hash]
[string token]

generateForgotPasswordToken

package string generateForgotPasswordToken([any user_id])
Parameters:
[any user_id]

getAllUsers

public query getAllUsers()
Returns a list of all users


getAuditEventFrequency

package numeric getAuditEventFrequency(string event_type, [string user_id="0"], [string ip_address=""])
returns the number of times the event was logged in the past hour

Parameters:
string event_type - An event_type of list of event types.
[string user_id="0"]
[string ip_address=""]

getDescription

public string getDescription()
Returns a description of where the data is stored, eg datasource name.


getUserByEmail

public query getUserByEmail([any email])
Returns user info query by email address

Parameters:
[any email]

getUserByID

public query getUserByID([any user_id])
Parameters:
[any user_id]

init

public any init([any firewallInstance])
Initialize the Authenticator on firewall configure.

Parameters:
[any firewallInstance]

reAuthorizePassword

public boolean reAuthorizePassword([string password], [any user_id="#getAuthenticatedUserID()#"])
Allows for reAuthorization via password for sensitive operations.

Parameters:
[string password]
[any user_id="#getAuthenticatedUserID()#"]

setDatasource

public void setDatasource(any datasource, [any username=""], [any password=""], [any dbtype=""])
Sets the datasource name.

Parameters:
any datasource - The name of a valid datasource
[any username=""] - Optional, the datasource username
[any password=""] - Optional, the datasource password
[any dbtype=""] - mysql, sqlserver, or derby

updateUser

public string updateUser([string user_id], [struct user])
Updates or creates a user by passing in a struct with keys email, roles, enabled, etc. Performs security checks to make sure the current user may perform this action as well. Returns the user id of the new or existing user.

Parameters:
[string user_id]
[struct user]

verifyForgotPasswordToken

package boolean verifyForgotPasswordToken([any user_id], [any token])
Parameters:
[any user_id]
[any token]