@RequestScoped public class PamManagementWs extends Object
Modifier and Type | Class and Description |
---|---|
static class |
PamManagementWs.ErrorCodes |
static class |
PamManagementWs.PAMManagementWSFault |
static class |
PamManagementWs.State |
Constructor and Description |
---|
PamManagementWs() |
Modifier and Type | Method and Description |
---|---|
boolean |
addUser(String userId,
char[] password,
boolean mustBeChanged,
Boolean chapCompatibility)
Adds a new user to the database and sets the new password.
|
char[] |
addUserGenPwd(String userId,
boolean mustBeChanged,
Boolean chapCompatibility)
Adds a new user to the database and generates a new random password.
|
PamUserInfo |
getUserInfo(String userId)
Returns the requested user info object, if it exists in the database.
|
List<String> |
getUsers(String filter,
com.kobil.ssms.kernel.presentation.b2b.RangeInput rangeInput,
com.kobil.ssms.kernel.logic.pagination.OrderInput orderInput,
Holder<com.kobil.ssms.kernel.presentation.b2b.Pagination> pagination)
Returns a list of user IDs, which exists in the database and match the given filter.
|
boolean |
lockUser(String userId)
Lock the User.
|
boolean |
removePassword(String userId)
Removes a password.
|
boolean |
removeUser(String userId)
Removes a user.
|
char[] |
resetPassword(String userId,
boolean mustBeChanged,
Boolean chapCompatibility)
Randomly generates a new password, stores it for the given user,
optionally overwriting an existing password of this user, and returns it.
|
boolean |
setPassword(String userId,
char[] password,
boolean mustBeChanged,
Boolean chapCompatibility)
Sets a new password for the given user, optionally overwriting an already
exiting password.
|
boolean |
setState(String userId,
PamManagementWs.State state)
Sets the state of the password.
|
boolean |
unlockUser(String userId)
Sets the state of the referenced user from locked to unlocked.
|
public char[] resetPassword(String userId, boolean mustBeChanged, Boolean chapCompatibility) throws PamManagementWs.PAMManagementWSFault
If requested, the password is marked so that the user must change next time using it.
The password is generated with respect to password restrictions configured in PAM advanced setting. I.e. either restrictions are defined in PAM advanced settings or a custom specific extension is installed.
userId
- The user ID of an existing user in SSMS.mustBeChanged
- True, if the password must be changed when the user logs in
the next time.chapCompatibility
- (optional) If set to true, password is stored in a CHAP
compatible way. If this parameter is not provided, then
default configuration as defined in PAM Advanced Settings is
applied.PamManagementWs.PAMManagementWSFault
- PamManagementWs.ErrorCodes.PERMISSION_DENIED
- if the permission is denied.
PamManagementWs.ErrorCodes.USERID_INVALID
- if the userId is not valid.
PamManagementWs.ErrorCodes.USER_NOT_FOUND
- if the user does not exist.
PamManagementWs.ErrorCodes.NOT_PAM_USER
- if the user does not have an assigned password.
PamManagementWs.ErrorCodes.GENERAL_ERROR
- if an internal error occurred.public boolean setPassword(String userId, char[] password, boolean mustBeChanged, Boolean chapCompatibility) throws PamManagementWs.PAMManagementWSFault
If requested, the password is marked so that the user must change next time using it.
The password is verified according to configured password restrictions. I.e. either restrictions are defined in PAM advanced settings or a custom specific extension is installed.
userId
- The user ID of an existing user in SSMS.password
- The new password in clear text.mustBeChanged
- True, if the password must be changed when the user logs in
the next time.chapCompatibility
- (optional) If set to true, password is stored in a CHAP
compatible way. If this parameter is not provided, then
default configuration as defined in PAM Advanced Settings is
applied.true
if the password was set or changed. false
if the password could not be set or changed.PamManagementWs.PAMManagementWSFault
- PamManagementWs.ErrorCodes.PERMISSION_DENIED
- if the permission is denied.
PamManagementWs.ErrorCodes.USERID_INVALID
- if the userId is not valid.
PamManagementWs.ErrorCodes.PASSWORD_NULL
- if the password is null or empty.
PamManagementWs.ErrorCodes.USER_NOT_FOUND
- if the user does not exist.
PamManagementWs.ErrorCodes.INVALID_PASSWORD
- if the password is not valid.
PamManagementWs.ErrorCodes.GENERAL_ERROR
- if an internal error occurred.public boolean setState(String userId, PamManagementWs.State state) throws PamManagementWs.PAMManagementWSFault
userId
- The user ID of an existing user in SSMS.state
- The new state. (State.OK or State.MUST_BE_CHANGED)true
if the state was changed. false
if the state could not be changed.PamManagementWs.PAMManagementWSFault
- PamManagementWs.ErrorCodes.PERMISSION_DENIED
- if the permission is denied.
PamManagementWs.ErrorCodes.USERID_INVALID
- if the userId is not valid.
PamManagementWs.ErrorCodes.INVALID_STATE
- if the state is null.
PamManagementWs.ErrorCodes.USER_NOT_FOUND
- if the user does not exist.
PamManagementWs.ErrorCodes.NOT_PAM_USER
- if the user does not have an assigned password.
PamManagementWs.ErrorCodes.GENERAL_ERROR
- if an internal error occurred.public boolean lockUser(String userId) throws PamManagementWs.PAMManagementWSFault
userId
- The user ID of an existing user in SSMS.true
if the user was set from unlocked to lock.false
if the user was already in state locked.PamManagementWs.PAMManagementWSFault
- PamManagementWs.ErrorCodes.PERMISSION_DENIED
- if the permission is denied.
PamManagementWs.ErrorCodes.USERID_INVALID
- if the userId is not valid.
PamManagementWs.ErrorCodes.USER_NOT_FOUND
- if the user does not exist.
PamManagementWs.ErrorCodes.NOT_PAM_USER
- if the user does not have an assigned password.
PamManagementWs.ErrorCodes.GENERAL_ERROR
- if an internal error occurred.public boolean unlockUser(String userId) throws PamManagementWs.PAMManagementWSFault
userId
- The user ID of an existing user in SSMS.true
if the state was changed from locked to unlocked.false
if the no state transition was done since the user was already unlocked.PamManagementWs.PAMManagementWSFault
- PamManagementWs.ErrorCodes.PERMISSION_DENIED
- if the permission is denied.
PamManagementWs.ErrorCodes.USERID_INVALID
- if the userId is not valid.
PamManagementWs.ErrorCodes.USER_NOT_FOUND
- if the user does not exist.
PamManagementWs.ErrorCodes.NOT_PAM_USER
- if the user does not have an assigned password.
PamManagementWs.ErrorCodes.GENERAL_ERROR
- if an internal error occurred.public char[] addUserGenPwd(String userId, boolean mustBeChanged, Boolean chapCompatibility) throws PamManagementWs.PAMManagementWSFault
If requested, the password is marked so that the user must change next time using it.
userId
- A new user ID that does not exist in SSMS yet.mustBeChanged
- True, if the password must be changed when the user logs in the next time.chapCompatibility
- (optional) If set to true, password is stored in a CHAP
compatible way. If this parameter is not provided, then
default configuration as defined in PAM Advanced Settings is
applied.PamManagementWs.PAMManagementWSFault
- PamManagementWs.ErrorCodes.PERMISSION_DENIED
- if the permission is denied.
PamManagementWs.ErrorCodes.USERID_INVALID
- if the User-ID invalid.
PamManagementWs.ErrorCodes.GENERAL_ERROR
- if an internal error occurred.public boolean addUser(String userId, char[] password, boolean mustBeChanged, Boolean chapCompatibility) throws PamManagementWs.PAMManagementWSFault
If requested, the password is marked so that the user must change next time using it.
The password is verified according to configured password restrictions. I.e. either restrictions are defined in PAM advanced settings or a custom specific extension is installed.
userId
- The user ID.password
- The new password.mustBeChanged
- True, if the password must be changed when the user logs in the next time.chapCompatibility
- (optional) If set to true, password is stored in a CHAP
compatible way. If this parameter is not provided, then
default configuration as defined in PAM Advanced Settings is
applied.true
if the user was added. false
if the user could not be added (e.g. user already existed).PamManagementWs.PAMManagementWSFault
- PamManagementWs.ErrorCodes.PERMISSION_DENIED
- if the permission is denied.
PamManagementWs.ErrorCodes.USERID_INVALID
- if the User-ID invalid.
PamManagementWs.ErrorCodes.PASSWORD_NULL
- if the password is null or empty.
PamManagementWs.ErrorCodes.INVALID_PASSWORD
- if the password is not valid.
PamManagementWs.ErrorCodes.GENERAL_ERROR
- if an internal error occurred.public boolean removeUser(String userId) throws PamManagementWs.PAMManagementWSFault
userId
- The user ID of an existing user in SSMS.true
if the user was removed. false
if the user does not exist (anymore).PamManagementWs.PAMManagementWSFault
- PamManagementWs.ErrorCodes.PERMISSION_DENIED
- if the permission is denied.
PamManagementWs.ErrorCodes.USERID_INVALID
- if the User-ID invalid.
PamManagementWs.ErrorCodes.USER_DELETION_PROHIBITED
- if the deletion of the user is prohibited.
PamManagementWs.ErrorCodes.GENERAL_ERROR
- if an internal error occurred.public boolean removePassword(String userId) throws PamManagementWs.PAMManagementWSFault
userId
- The user ID of an existing user in SSMS.true
if the password was removed. false
if the password could not be removed.PamManagementWs.PAMManagementWSFault
- PamManagementWs.ErrorCodes.PERMISSION_DENIED
- if the permission is denied.
PamManagementWs.ErrorCodes.USERID_INVALID
- if the User-ID invalid.
PamManagementWs.ErrorCodes.USER_NOT_FOUND
- if the user does not found.
PamManagementWs.ErrorCodes.NOT_PAM_USER
- if the user does not have an assigned password.
PamManagementWs.ErrorCodes.GENERAL_ERROR
- if an internal error occurred.public PamUserInfo getUserInfo(String userId) throws PamManagementWs.PAMManagementWSFault
userId
- The user ID of an existing user in SSMS.PamUserInfo
object, containing user information.PamManagementWs.PAMManagementWSFault
- PamManagementWs.ErrorCodes.PERMISSION_DENIED
- if the permission is denied.
PamManagementWs.ErrorCodes.USERID_INVALID
- if the User-ID invalid.
PamManagementWs.ErrorCodes.USER_NOT_FOUND
- if the user does not found.
PamManagementWs.ErrorCodes.NOT_PAM_USER
- if the user does not have an assigned password.
PamManagementWs.ErrorCodes.GENERAL_ERROR
- if an internal error occurred.public List<String> getUsers(String filter, com.kobil.ssms.kernel.presentation.b2b.RangeInput rangeInput, com.kobil.ssms.kernel.logic.pagination.OrderInput orderInput, Holder<com.kobil.ssms.kernel.presentation.b2b.Pagination> pagination) throws PamManagementWs.PAMManagementWSFault
filter
- The filter requires a search String, regarding the userID.
Note: rangeInput
- - RangeInput object with information about range with "from" and "limit" values orderInput
- - OrderInput object with information about sorting field name and direction pagination
- - Holder for Pagination with information about range and order.
range is an object with "from", "limit" and "moreExist" values PamManagementWs.PAMManagementWSFault
- PamManagementWs.ErrorCodes.PERMISSION_DENIED
- if the permission is denied.
PamManagementWs.ErrorCodes.FILTER_INVALID
- if the filter is null or empty.
PamManagementWs.ErrorCodes.GENERAL_ERROR
- if an internal error occurred.Copyright © 2022 KOBIL Systems GmbH. All rights reserved.