public void setAnswer(String answer) { if(answer != null && answer.trim().length()>0) { this.updateAttribute(new IdentityAttribute("answer", answer)); } }
public void setInactiveCredential(String inactiveCredential) { if(inactiveCredential != null && inactiveCredential.trim().length()>0) { this.updateAttribute(new IdentityAttribute("inactive_credential", inactiveCredential)); } else { this.removeAttribute(new IdentityAttribute("inactive_credential", "")); } } //-------------------------------------------------------------------------------------------------------
public void setSecretQuestion(String secretQuestion) { if(secretQuestion != null && secretQuestion.trim().length()>0) { this.updateAttribute(new IdentityAttribute("secretQuestion", secretQuestion)); } }
public IdentityAttribute readAttribute(String name) { return this.find(new IdentityAttribute(name, null)); }
public void activate() { IdentityAttribute active = this.readAttribute("active"); if(active == null) { active = new IdentityAttribute("active", Boolean.TRUE.toString()); this.addAttribute(active); } else { active.setValue(Boolean.TRUE.toString()); this.updateAttribute(active); } }
public void deactivate() { IdentityAttribute active = this.readAttribute("active"); if(active == null) { active = new IdentityAttribute("active", Boolean.FALSE.toString()); this.addAttribute(active); } else { active.setValue(Boolean.FALSE.toString()); this.updateAttribute(active); } }
identity.setPrincipal(email); identity.setCredential(authenticationHash); identity.addAttribute(new IdentityAttribute("email", email)); identity.setInactiveCredential(credential); identity.activate();