Installation and Usage
- Lucee 5+
- Adobe ColdFusion 2016+
- Coldbox 4.3 +
cbauth
can be installed withbox install cbauth
cbauth needs a
userServiceClass
which has to be specified in the module settings. It should be a WireBox mapping that resolves to a component that implements the IUserService
interface (though this implementation can be implicit.)By default, cbauth uses
[email protected]
and [email protected]
for the sessionStorage
and requestStorage
, respectively.Your config settings will look like this:
moduleSettings = {
cbauth: {
userServiceClass: "UserService",
// optional, override when needed
sessionStorage: "[email protected]",
requestStorage: "[email protected]"
},
//..... other module settings
}
You can specify other
requestStorage
or sessionStorage
(e.g distributed cache) as long as your new storages follow the Interface definitions as defined:interface name="SessionStorageInterface" { // or "RequestStorageInterface"
public any function getVar( required string name, any defaultValue );
public void function setVar( required string name, required any value );
public boolean function deleteVar( required string name );
public boolean function exists( required string name );
}
You don't have to formally implement the interface in your code.
interface {
/**
* Verify if the incoming username/password are valid credentials.
*
* @username The username
* @password The password
*/
boolean function isValidCredentials( required username, required password );