c
c
cbAuth
Search…
IUserService
You have to create a UserService and specify a userServiceClass in your moduleSettings. This UserService needs to have three methods, according to cbauth.interfaces.IUserService
1
interface {
2
3
/**
4
* Verify if the incoming username/password are valid credentials.
5
*
6
* @username The username
7
* @password The password
8
*/
9
boolean function isValidCredentials( required username, required password );
10
11
/**
12
* Retrieve a user by username
13
*
14
* @return User that implements IAuthUser
15
*/
16
function retrieveUserByUsername( required username );
17
18
/**
19
* Retrieve a user by unique identifier
20
*
21
* @id The unique identifier
22
*
23
* @return User that implements IAuthUser
24
*/
25
function retrieveUserById( required id );
26
}
Copied!
If you want to implement a UserService for cbauth combined with cbsecurity you will find your interface specification in cbsecurity.interfaces.IUserService. Methods in this spec are equal.
The user component returned by both retrieve... methods needs to respond to getId() as specified by the IAuthUser interface.
Combined with cbsecurity or cbguard you might have to specify additional methods for checking roles or permissions.
Last modified 1yr ago
Copy link
Edit on GitHub