jet.server.userman
Interface UserAuthenticator


public interface UserAuthenticator

Customized Authentication

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.


Field Summary
static int ACCESS
           
static int MANAGE
           
 
Method Summary
 java.lang.String changePassword(java.lang.String realmName, java.lang.String implUserName, java.lang.String userName, java.lang.String oldPwd, java.lang.String newPwd)
          Change user password.
 boolean getAuditState(java.lang.String realmName, java.lang.String userName, int type, boolean success)
          Get the audit state setting.
 UserMailList getMailList()
          Get the user mail list.
 java.lang.String getPassword(java.lang.String realmName, java.lang.String userName)
          Get the user password
 java.util.Enumeration getRealmNames()
          Get the realm list.
 java.util.Enumeration getUserNames(java.lang.String realmName)
          Get 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)
          Check if the user has the permission to do the action on specific version of resource
 boolean isPermissionOk(java.lang.String realmName, java.lang.String userName, java.lang.String uri, java.lang.String cmd)
          Check if the user has the permission to do the action
 boolean isValidAdminUser(java.lang.String realmName, java.lang.String userName, java.lang.String password)
          Check if the user can access the administration tools.
 boolean isValidUser(java.lang.String realmName, java.lang.String userName, java.lang.String password)
          Check if the user is a valid one.
 

Field Detail

ACCESS

static final int ACCESS
See Also:
Constant Field Values

MANAGE

static final int MANAGE
See Also:
Constant Field Values
Method Detail

changePassword

java.lang.String changePassword(java.lang.String realmName,
                                java.lang.String implUserName,
                                java.lang.String userName,
                                java.lang.String oldPwd,
                                java.lang.String newPwd)
Change user password.

Parameters:
realmName - the realm name
implUserName - the user name who invoke the action
userName - the user name whose password need to be changed
oldPwd - old password
newPwd - new password
Returns:
error message if fail, or null if success

isPermissionOk

boolean isPermissionOk(java.lang.String realmName,
                       java.lang.String userName,
                       java.lang.String uri,
                       java.lang.String cmd)
Check if the user has the permission to do the action

Parameters:
realmName - the realm name
userName - the user name
uri - the request URI the uri equals a special string APIConst.PRIVILEGE_URI means this method is used to check privilege, do the privilege checking. For example, if this method used to check privilege, it will be invoked as: isPermissionOk(realmName, userName, APIConst.PRIVILEGE_URI, cmd);
cmd - the action need to be invoked. see brsow2cmd.htm for detail information
Returns:
true if the user has the permission

isPermissionOk

boolean isPermissionOk(java.lang.String realmName,
                       java.lang.String userName,
                       java.lang.String uri,
                       int versionNumber,
                       java.lang.String cmd)
Check if the user has the permission to do the action on specific version of resource

Parameters:
realmName - the realm name
userName - the user name
uri - the request URI
versionNumber - version number of the resource that URI specified
cmd - the action need to be invoked. see brsow2cmd.htm for detail information
Returns:
true if the user has the permission

isValidUser

boolean isValidUser(java.lang.String realmName,
                    java.lang.String userName,
                    java.lang.String password)
Check if the user is a valid one. A valid user must exist and provide valid password.

Parameters:
realmName - the realm name
userName - the user name
password - the user password
Returns:
true if the user exists and the password is true

isValidAdminUser

boolean isValidAdminUser(java.lang.String realmName,
                         java.lang.String userName,
                         java.lang.String password)
Check if the user can access the administration tools.

Parameters:
realmName - the realm name
userName - the user name
password - the user password
Returns:
true if the user can access the administration tools.

getPassword

java.lang.String getPassword(java.lang.String realmName,
                             java.lang.String userName)
Get the user password

Parameters:
realmName - the realm name
userName - the user name
Returns:
the user password, null if any error occurs.

getRealmNames

java.util.Enumeration getRealmNames()
Get the realm list. Almost everything, include user, group, resource and schedule, is defined within realm. Users are different if they have same name, but in different realm. We must use user name and realm name together to define a user.

Returns:
the realm names. Each element is a String.

getUserNames

java.util.Enumeration getUserNames(java.lang.String realmName)
Get 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)
Get the audit state setting. The audit setting differs with user. If one user's audit setting is false, the user's action will not be logged. Action has different type. Now we define two types: ACCESS and MANAGE. ACCESS denotes action accesing to the resource and MANAGE denotes action managing the server. We can also select whether to log if the action success or fail

Parameters:
realmName - the realm name
userName - the user name
type - the target type, it must be one of the const defined above
success - denote audit success or fail
Returns:
the audit state

getMailList

UserMailList getMailList()
Get the user mail list. User can customized user mail list scheme by implementing interface jet.server.api.UserMailList.

Returns:
the user mail list interface
See Also:
UserMailList