Class IdentityServiceAccountProvider
java.lang.Object
fr.becpg.repo.authentication.provider.IdentityServiceAccountProvider
IdentityServiceAccountProvider class.
- Version:
- $Id: $Id
- Author:
- matthieu
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate Stringprivate Stringprivate Booleanprivate static final StringConstantGET_USER_ID_ERROR="Could not find userId from identity ser"{trunked}private Stringprivate Stringprivate static org.apache.commons.logging.LogConstantloggerprivate static final PatternConstantPROHIBITED_CHARSprivate String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate org.alfresco.repo.security.authentication.identityservice.IdentityServiceExceptionasIdentityServiceException(String username, RuntimeException cause) asIdentityServiceException.voiddeleteAccount(String username) deleteAccount.private StringgetAdminAccessToken.private StringgetUserId.getZoneId.isEnabled.booleanregisterAccount(BeCPGUserAccount userAccount) registerAccount.private voidregisterInitialPassword(BeCPGUserAccount userAccount) registerInitialPassword.private voidrollbackAccount(String username) rollbackAccount.private Stringsanitize.toString()The admin password and the client secret are deliberately left out so that logging this provider never leaks them.voidupdatePassword(String username, String newPassword) updatePassword.booleanupdateUser(BeCPGUserAccount userAccount) updateUser.
-
Field Details
-
PROHIBITED_CHARS
ConstantPROHIBITED_CHARS -
GET_USER_ID_ERROR
ConstantGET_USER_ID_ERROR="Could not find userId from identity ser"{trunked}- See Also:
-
logger
private static org.apache.commons.logging.Log loggerConstantlogger -
enabled
-
identityServiceUserName
-
identityServicePassword
-
realm
-
clientId
-
clientSecret
-
authServerUrl
-
-
Constructor Details
-
IdentityServiceAccountProvider
public IdentityServiceAccountProvider()
-
-
Method Details
-
isEnabled
isEnabled.
- Returns:
- a
Booleanobject
-
getZoneId
getZoneId.
- Returns:
- a
Stringobject
-
registerAccount
registerAccount.
Creates the account in the identity service, together with its initial credential when the given account carries a password.- Parameters:
userAccount- aBeCPGUserAccountobject- Returns:
- true when the account was created, false when it already exists in the identity service
- Throws:
org.alfresco.repo.security.authentication.identityservice.IdentityServiceException- if the account cannot be registered
-
registerInitialPassword
registerInitialPassword.
Stores the initial credential of a freshly created account. The account is rolled back when the credential cannot be stored, otherwise a later creation attempt would reuse an account without any password and the user would never be able to sign in.- Parameters:
userAccount- aBeCPGUserAccountobject- Throws:
org.alfresco.repo.security.authentication.identityservice.IdentityServiceException- if the credential cannot be stored
-
asIdentityServiceException
private org.alfresco.repo.security.authentication.identityservice.IdentityServiceException asIdentityServiceException(String username, RuntimeException cause) asIdentityServiceException.
Normalizes a registration failure so that callers cleaning up after a failed registration only have to handleIdentityServiceException.- Parameters:
username- aStringobjectcause- aRuntimeExceptionobject- Returns:
- a
IdentityServiceExceptionobject
-
rollbackAccount
rollbackAccount.
Deletes an account created by a failed registration, without hiding the registration failure.- Parameters:
username- aStringobject
-
deleteAccount
deleteAccount.
- Parameters:
username- aStringobject
-
updateUser
updateUser.
- Parameters:
userAccount- aBeCPGUserAccountobject- Returns:
- a boolean
-
sanitize
sanitize.
-
updatePassword
updatePassword.
-
getUserId
getUserId.
-
getAdminAccessToken
getAdminAccessToken.
- Returns:
- a
Stringobject
-
toString
The admin password and the client secret are deliberately left out so that logging this provider never leaks them.
-