@Override protected PasswordType getCredential(CredentialsType credentials) { return credentials.getPassword(); }
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); }
public CredentialsType clone() { CredentialsType object = new CredentialsType(); PrismContainerValue value = asPrismContainerValue().clone(); object.setupContainerValue(value); return object; }
public static CredentialsType createPasswordCredentials(String password) { CredentialsType credentialsType = new CredentialsType(); credentialsType.setPassword(createPasswordType(password)); return credentialsType; }
public static void setPassword(CredentialsType credentials, ProtectedStringType password) { PasswordType credPass = credentials.getPassword(); if (credPass == null) { credPass = new PasswordType(); credentials.setPassword(credPass); } credPass.setValue(password); }
/** * Create an instance of {@link CredentialsType } * */ public CredentialsType createCredentialsType() { return new CredentialsType(); }
resetFailedLogins(focusContext, credentialsTypeNew.getPassword(), SchemaConstants.PATH_CREDENTIALS_PASSWORD_FAILED_LOGINS); resetFailedLogins(focusContext, credentialsTypeNew.getNonce(), SchemaConstants.PATH_CREDENTIALS_NONCE_FAILED_LOGINS); resetFailedLogins(focusContext, credentialsTypeNew.getSecurityQuestions(), SchemaConstants.PATH_CREDENTIALS_SECURITY_QUESTIONS_FAILED_LOGINS);
CredentialsType credentials = new CredentialsType(prismContext) .beginPassword() .value(value) .end();
public CredentialsType password(PasswordType value) { setPassword(value); return this; }
@Override public boolean equals(Object object) { if (!(object instanceof CredentialsType)) { return false; } CredentialsType other = ((CredentialsType) object); return asPrismContainerValue().equivalent(other.asPrismContainerValue()); }
@Override protected NonceType getCredential(CredentialsType credentials) { return credentials.getNonce(); }
.beginPassword() .value(value.clone()) .beginMetadata() .<PasswordType>end() .<CredentialsType>end() .<UserType>end() .asPrismObject(); PrismObject<UserType> user2 = new UserType(prismContext) .beginCredentials() .beginPassword() .value(value.clone()) .beginMetadata() .<PasswordType>end() .<CredentialsType>end() .<UserType>end() .asPrismObject();
private PrismObject<UserType> createUserWill() throws SchemaException { PrismObject<UserType> user = prismContext.getSchemaRegistry().findObjectDefinitionByCompileTimeClass(UserType.class).instantiate(); user.asObjectable() .name(USER_WILL_NAME) .givenName(USER_WILL_GIVEN_NAME) .familyName(USER_WILL_FAMILY_NAME) .fullName(USER_WILL_FULL_NAME) .beginActivation().administrativeStatus(ActivationStatusType.ENABLED).<UserType>end() .beginCredentials().beginPassword().beginValue().setClearValue(USER_WILL_PASSWORD_OLD); return user; }
public static CredentialsType createPasswordCredentials(String password) { CredentialsType credentialsType = new CredentialsType(); credentialsType.setPassword(createPasswordType(password)); return credentialsType; }
/** * Create an instance of {@link CredentialsType } * */ public CredentialsType createCredentialsType() { return new CredentialsType(); }
CredentialsType credentials = new CredentialsType(prismContext) .beginPassword() .value(value) .end();
@XmlElement(name = "password") public PasswordType getPassword() { return PrismForJAXBUtil.getFieldSingleContainerable(asPrismContainerValue(), F_PASSWORD, PasswordType.class); }
private String getNonce(UserType user) { if (user.getCredentials() == null) { return null; } if (user.getCredentials().getNonce() == null) { return null; } if (user.getCredentials().getNonce().getValue() == null) { return null; } try { return getPlaintext(user.getCredentials().getNonce().getValue()); } catch (EncryptionException e) { return null; } }
public static ProtectedStringType getPasswordValue(UserType user) { if (user == null) { return null; } CredentialsType creds = user.getCredentials(); if (creds == null) { return null; } PasswordType passwd = creds.getPassword(); if (passwd == null) { return null; } return passwd.getValue(); }
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); }