models.auth

Class BasicAuthUserService

lucee.Component
    extended by models.auth.BasicAuthUserService

Copyright since 2016 by Ortus Solutions, Corp www.ortussolutions.com --- This user service is based off a basic auth configuration of users in the application's security configuration. A single ColdBox application can have a main dictionary of users and modules can collaborate users as well.

Class Attributes:
  • singleton
  •  
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
    Property Summary
    type property default serializable required
    any populator


    • access = public
    • returntype = any
    • inject = wirebox:populator
    true false
    any settings


    • access = public
    • returntype = any
    • inject = coldbox:moduleSettings:cbsecurity
    true false
    any wirebox


    • access = public
    • returntype = any
    • inject = wirebox
    true false
    Constructor Summary
    init()
          Constructor.
    Method Summary
    private any getNewUserTemplate()
         Create a new user template for basic auth.
    string getPopulator()
    string getSettings()
    array getUsers()
         Get an array of registered users with this service.
    string getWirebox()
    string hashSecurely(string target)
         Hash the incoming target according to our hashing algorithm and settings.
    boolean isValidCredentials(any username, any password)
         Verify if the incoming username and password are valid credentials in this user storage.
    User new()
         New User dispenser.
    any onDIComplete()
    User retrieveUserById(any id)
         Get a new user by id.
    User retrieveUserByUsername(any username)
         Get a user by username.
    any setPopulator(any populator)
    any setSettings(any settings)
    any setWirebox(any wirebox)
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init()

    Constructor


    Property Detail

    populator

    property any populator

    Attributes:
    access - public
    required - false
    returntype - any
    inject - wirebox:populator
    serializable - true

    settings

    property any settings

    Attributes:
    access - public
    required - false
    returntype - any
    inject - coldbox:moduleSettings:cbsecurity
    serializable - true

    wirebox

    property any wirebox

    Attributes:
    access - public
    required - false
    returntype - any
    inject - wirebox
    serializable - true

    Method Detail

    getNewUserTemplate

    private any getNewUserTemplate()

    Create a new user template for basic auth


    getPopulator

    public string getPopulator()


    getSettings

    public string getSettings()


    getUsers

    public array getUsers()

    Get an array of registered users with this service


    getWirebox

    public string getWirebox()


    hashSecurely

    public string hashSecurely(string target)

    Hash the incoming target according to our hashing algorithm and settings

    Parameters:
    target - The string target to hash

    isValidCredentials

    public boolean isValidCredentials(any username, any password)

    Verify if the incoming username and password are valid credentials in this user storage

    Parameters:
    username - The username to test
    password - The password to test
    Returns:
    true if valid, else false

    new

    public User new()

    New User dispenser


    onDIComplete

    public any onDIComplete()


    retrieveUserById

    public User retrieveUserById(any id)

    Get a new user by id

    Parameters:
    id - The id to get the user with
    Returns:
    The located user or a new un-loaded user object

    retrieveUserByUsername

    public User retrieveUserByUsername(any username)

    Get a user by username

    Parameters:
    username - The username to get the user with
    Returns:
    The valid user object representing the username or an empty user object

    setPopulator

    public any setPopulator(any populator)

    Parameters:
    populator

    setSettings

    public any setSettings(any settings)

    Parameters:
    settings

    setWirebox

    public any setWirebox(any wirebox)

    Parameters:
    wirebox