/** * Create an instance of {@link PasswordType } * */ public PasswordType createPasswordType() { return new PasswordType(); }
/** * Create an instance of {@link PasswordType } * */ public PasswordType createPasswordType() { return new PasswordType(); }
/** * Create an instance of {@link PasswordType } * */ public PasswordType createPasswordType() { return new PasswordType(); }
public PasswordType beginPassword() { PasswordType value = new PasswordType(); password(value); return value; }
public static PasswordType createPasswordType(String password) { PasswordType passwordType = new PasswordType(); passwordType.setValue(createProtectedString(password)); return passwordType; }
public static void setPassword(CredentialsType credentials, ProtectedStringType password) { PasswordType credPass = credentials.getPassword(); if (credPass == null) { credPass = new PasswordType(); credentials.setPassword(credPass); } credPass.setValue(password); }
public PasswordType clone() { PasswordType object = new PasswordType(); PrismContainerValue value = asPrismContainerValue().clone(); object.setupContainerValue(value); return object; }
public static PasswordType createPasswordType(String password) { PasswordType passwordType = new PasswordType(); passwordType.setValue(createProtectedString(password)); return passwordType; }
public static void setPassword(ShadowType shadowType, ProtectedStringType password) { CredentialsType credentialsType = shadowType.getCredentials(); if (credentialsType == null) { credentialsType = new CredentialsType(); shadowType.setCredentials(credentialsType); } PasswordType passwordType = credentialsType.getPassword(); if (passwordType == null) { passwordType = new PasswordType(); credentialsType.setPassword(passwordType); } passwordType.setValue(password); }
protected void modifyUserSetPassword(String userOid, String newPassword, Task task, OperationResult result) throws ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException, ObjectAlreadyExistsException, PolicyViolationException, SecurityViolationException { ProtectedStringType userPasswordPs = new ProtectedStringType(); userPasswordPs.setClearValue(newPassword); PasswordType passwordType = new PasswordType(); passwordType.setValue(userPasswordPs); ObjectDelta<UserType> delta = prismContext.deltaFor(UserType.class) .item(SchemaConstants.PATH_PASSWORD).add(passwordType) .asObjectDelta(userOid); executeChanges(delta, null, task, result); }
public static void setPasswordIncomplete(ShadowType shadowType) throws SchemaException { CredentialsType credentialsType = shadowType.getCredentials(); if (credentialsType == null) { credentialsType = new CredentialsType(); shadowType.setCredentials(credentialsType); } PasswordType passwordType = credentialsType.getPassword(); if (passwordType == null) { passwordType = new PasswordType(); credentialsType.setPassword(passwordType); } PrismContainerValue<PasswordType> passwordContainer = passwordType.asPrismContainerValue(); PrismProperty<ProtectedStringType> valueProperty = passwordContainer.findOrCreateProperty(PasswordType.F_VALUE); valueProperty.setIncomplete(true); }
protected void setPassword(PrismObject<UserType> user, String password) { UserType userType = user.asObjectable(); CredentialsType creds = userType.getCredentials(); if (creds == null) { creds = new CredentialsType(); userType.setCredentials(creds); } PasswordType passwordType = creds.getPassword(); if (passwordType == null) { passwordType = new PasswordType(); creds.setPassword(passwordType); } ProtectedStringType ps = new ProtectedStringType(); ps.setClearValue(password); passwordType.setValue(ps); }
private void transplantPasswordMetadata(ShadowType repoShadowType, ShadowType resultAccountShadow) { CredentialsType repoCreds = repoShadowType.getCredentials(); if (repoCreds == null) { return; } PasswordType repoPassword = repoCreds.getPassword(); if (repoPassword == null) { return; } MetadataType repoMetadata = repoPassword.getMetadata(); if (repoMetadata == null) { return; } CredentialsType resultCreds = resultAccountShadow.getCredentials(); if (resultCreds == null) { resultCreds = new CredentialsType(); resultAccountShadow.setCredentials(resultCreds); } PasswordType resultPassword = resultCreds.getPassword(); if (resultPassword == null) { resultPassword = new PasswordType(); resultCreds.setPassword(resultPassword); } MetadataType resultMetadata = resultPassword.getMetadata(); if (resultMetadata == null) { resultMetadata = repoMetadata.clone(); resultPassword.setMetadata(resultMetadata); } }
PasswordType pass = new PasswordType(); pass.setValue(ps); credentials.setPassword(pass);
PasswordType passwordType = new PasswordType(); passwordType.setValue(userPasswordPs);
PasswordType passwordType = new PasswordType(); ProtectedStringType passwordPs = new ProtectedStringType(); passwordPs.setClearValue(USER_SHARPTOOTH_PASSWORD_1_CLEAR);
/** * MID-4593 */ @Test public void test924AddPassword() throws Exception { final String TEST_NAME = "test924AddPassword"; displayTestTitle(TEST_NAME); // GIVEN Task task = createTask(TEST_NAME); OperationResult result = task.getResult(); prepareTest(); setPasswordMinOccurs(0, task, result); UserType user = new UserType(prismContext).name("charlie"); addObject(user.asPrismObject(), task, result); PrismObject<UserType> userReloaded = getUser(user.getOid()); assertNull("user has credentials", userReloaded.asObjectable().getCredentials()); // WHEN ProtectedStringType value = new ProtectedStringType(); value.setClearValue(PASSWORD_HELLO_WORLD); PasswordType password = new PasswordType(prismContext).value(value); ObjectDelta<UserType> objectDelta = prismContext.deltaFor(UserType.class) .item(UserType.F_CREDENTIALS, CredentialsType.F_PASSWORD).add(password) .asObjectDeltaCast(user.getOid()); executeChanges(objectDelta, null, task, result); // THEN PrismObject<UserType> userAfter = getUser(user.getOid()); display("user after operation", userAfter); assertUserPassword(userAfter, PASSWORD_HELLO_WORLD); assertPasswordCreateMetadata(userAfter); }
/** * MID-4593 */ @Test public void test926ReplacePassword() throws Exception { final String TEST_NAME = "test926ReplacePassword"; displayTestTitle(TEST_NAME); // GIVEN Task task = createTask(TEST_NAME); OperationResult result = task.getResult(); prepareTest(); setPasswordMinOccurs(0, task, result); UserType user = new UserType(prismContext).name("david"); addObject(user.asPrismObject(), task, result); PrismObject<UserType> userReloaded = getUser(user.getOid()); assertNull("user has credentials", userReloaded.asObjectable().getCredentials()); // WHEN ProtectedStringType value = new ProtectedStringType(); value.setClearValue(PASSWORD_HELLO_WORLD); PasswordType password = new PasswordType(prismContext).value(value); ObjectDelta<UserType> objectDelta = prismContext.deltaFor(UserType.class) .item(UserType.F_CREDENTIALS, CredentialsType.F_PASSWORD).replace(password) .asObjectDeltaCast(user.getOid()); executeChanges(objectDelta, null, task, result); // THEN PrismObject<UserType> userAfter = getUser(user.getOid()); display("user after operation", userAfter); assertUserPassword(userAfter, PASSWORD_HELLO_WORLD); assertPasswordCreateMetadata(userAfter); }
PasswordType newPassword = new PasswordType(getPrismContext()).value(value); ObjectDelta<UserType> userDelta1 = getPrismContext().deltaFor(UserType.class) .item(UserType.F_CREDENTIALS, CredentialsType.F_PASSWORD).replace(newPassword)