jet.server.api.custom.security
Interface AuthenticationProvider


public interface AuthenticationProvider

JReport Enterprise Server provides the ability to use customized user authentication scheme. Since version 7.1, customer can implement the interface jet.server.api.custom.security.AuthenticationProvider and import the customized class file by modifying the following JReport Enterprise Server's properties file:
<SERVER PATH>/bin/server.properties or by specifying jvm -D parameter.

When using customized user authentication scheme, user should:
1. Write a class which implements the interface jet.server.api.custom.AuthenticationProvider.
2. Put the class into CLASSPATH which used by launching JReport Enterprise Server
3. Edit file <SERVER PATH>/bin/server.properties, add a name/value pair, name is custom.security.AuthenticationProvider, value points to the customized class. or specify customized class via -D paramter of jvm, name is com.jinfonet.AuthenticationProvider, value pointes to the customized class.
4. Restart JReport Enterprise Server and the customized user authentication is working.

Since:
version 7.1
See Also:
AuthorizationProvider

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 isAdminUser(java.lang.String realmName, java.lang.String userName)
          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.
 

Method Detail

isValidUser

public 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

isAdminUser

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

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

changePassword

public 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