public interface UserAuthenticator
JReport Enterprise Server provides the ability to use customized user authentication scheme.
A customized user authentication scheme must implement the interface
jet.server.UserAuthenticator
, and import the customized class file by
modifying the following JReport Enterprise Server's properties file:
<SERVER PATH>/bin/classes.properties
When using customized user authentication scheme, user should:
1. Write a class which implements the interface
jet.server.UserAuthenticator
.
2. Put the class into CLASSPATH which used by launching JReport Enterprise Server
3. Edit file <SERVER PATH>/bin/classes.properties
, let name
UserAuthenticator
point to the customized class
4. Restart JReport Enterprise Server and the customized user authentication is working.
Modifier and Type | Method and Description |
---|---|
java.lang.String |
changePassword(java.lang.String realmName,
java.lang.String implUserName,
java.lang.String userName,
java.lang.String oldPwd,
java.lang.String newPwd)
Changes user password.
|
java.lang.String |
changePasswordEx(java.lang.String realmName,
java.lang.String implUserName,
java.lang.String userName,
java.lang.String oldPwd,
java.lang.String newPwd)
Changes user password.
|
boolean |
getAuditState(java.lang.String realmName,
java.lang.String userName,
int type,
boolean success)
Gets the audit state setting.
|
UserMailList |
getMailList()
Gets the user mail list.
|
java.lang.String |
getPassword(java.lang.String realmName,
java.lang.String userName)
Gets the user password
|
java.util.Enumeration |
getRealmNames()
Gets the realm list.
|
java.util.Enumeration |
getUserNames(java.lang.String realmName)
Gets the user names in the realm.
|
boolean |
isPermissionOk(java.lang.String realmName,
java.lang.String userName,
java.lang.String uri,
int versionNumber,
java.lang.String cmd)
Checks if the user has the permission to do the action on a specific version of resource
|
boolean |
isPermissionOk(java.lang.String realmName,
java.lang.String userName,
java.lang.String uri,
java.lang.String cmd)
Checks if the user has the permission to do the action
|
boolean |
isValidAdminUser(java.lang.String realmName,
java.lang.String userName,
java.lang.String password)
Checks if the user can access the administration tools.
|
boolean |
isValidUser(java.lang.String realmName,
java.lang.String userName,
java.lang.String password)
Checks if the user is a valid one.
|
static final int ACCESS
static final int MANAGE
java.lang.String changePassword(java.lang.String realmName, java.lang.String implUserName, java.lang.String userName, java.lang.String oldPwd, java.lang.String newPwd)
realmName
- the realm nameimplUserName
- the user name who invoked the actionuserName
- the user name whose password needs to be changedoldPwd
- the old passwordnewPwd
- the new passwordjava.lang.String changePasswordEx(java.lang.String realmName, java.lang.String implUserName, java.lang.String userName, java.lang.String oldPwd, java.lang.String newPwd) throws InvalidPasswordException
realmName
- the realm nameimplUserName
- the user name who invoked the actionuserName
- the user name whose password needs to be changedoldPwd
- the old passwordnewPwd
- the new passwordInvalidPasswordException
- if password not match advanced password ruleboolean isPermissionOk(java.lang.String realmName, java.lang.String userName, java.lang.String uri, java.lang.String cmd)
realmName
- the realm nameuserName
- the user nameuri
- the request URI
the uri equals a special string APIConst.PRIVILEGE_URI which means this method is used to
check privileges.
For example, if this method is used to check privileges, it will be invoked as:
isPermissionOk(realmName, userName, APIConst.PRIVILEGE_URI, cmd);cmd
- the action needed to be invoked. see brsow2cmd.htm
for detailed informationboolean isPermissionOk(java.lang.String realmName, java.lang.String userName, java.lang.String uri, int versionNumber, java.lang.String cmd)
realmName
- the realm nameuserName
- the user nameuri
- the request URIversionNumber
- version number of the resource specified by URIcmd
- the action needed to be invoked. see brsow2cmd.htm
for detailed informationboolean isValidUser(java.lang.String realmName, java.lang.String userName, java.lang.String password)
realmName
- the realm nameuserName
- the user namepassword
- the user passwordboolean isValidAdminUser(java.lang.String realmName, java.lang.String userName, java.lang.String password)
realmName
- the realm nameuserName
- the user namepassword
- the user passwordjava.lang.String getPassword(java.lang.String realmName, java.lang.String userName)
realmName
- the realm nameuserName
- the user namejava.util.Enumeration getRealmNames()
String.
-
getUserNames
java.util.Enumeration getUserNames(java.lang.String realmName)
Gets the user names in the realm.
- Parameters:
realmName
- the realm name
- Returns:
- the user names in the realm. Each element is a
String.
-
getAuditState
boolean getAuditState(java.lang.String realmName,
java.lang.String userName,
int type,
boolean success)
Gets the audit state setting. The audit setting differs with users.
If one user's audit setting is false, the user's action will not be logged.
Actions have different type. Now we define two types: ACCESS and MANAGE.
ACCESS denotes action accessing to the resource and MANAGE denotes action
managing the server. We can also select whether to log if the action
succeeded or failed
- Parameters:
realmName
- the realm name
userName
- the user name
type
- the target type, which must be one of the constants defined above
success
- denotes whether audit succeeded or failed
- Returns:
- the audit state
-
getMailList
UserMailList getMailList()
Gets the user mail list. Users can customize user mail list scheme by implementing
the interface jet.server.api.UserMailList.
- Returns:
- the user mail list interface
- See Also:
UserMailList