Search in sources :

Example 16 with CustomAttribute

use of org.xdi.ldap.model.CustomAttribute in project oxAuth by GluuFederation.

the class AuthenticationService method checkUserStatus.

private boolean checkUserStatus(User user) {
    CustomAttribute userStatus = userService.getCustomAttribute(user, "gluuStatus");
    if ((userStatus != null) && GluuStatus.ACTIVE.equals(GluuStatus.getByValue(userStatus.getValue()))) {
        return true;
    }
    log.warn("User '{}' was disabled", user.getUserId());
    return false;
}
Also used : CustomAttribute(org.xdi.ldap.model.CustomAttribute)

Example 17 with CustomAttribute

use of org.xdi.ldap.model.CustomAttribute in project oxAuth by GluuFederation.

the class ClientService method setCustomAttribute.

public void setCustomAttribute(Client client, String attributeName, String attributeValue) {
    org.xdi.ldap.model.CustomAttribute customAttribute = getCustomAttribute(client, attributeName);
    if (customAttribute == null) {
        customAttribute = new org.xdi.ldap.model.CustomAttribute(attributeName);
        client.getCustomAttributes().add(customAttribute);
    }
    customAttribute.setValue(attributeValue);
}
Also used : CustomAttribute(org.xdi.ldap.model.CustomAttribute)

Aggregations

CustomAttribute (org.xdi.ldap.model.CustomAttribute)17 User (org.xdi.oxauth.model.common.User)5 ArrayList (java.util.ArrayList)4 JSONArray (org.codehaus.jettison.json.JSONArray)2 EntryPersistenceException (org.gluu.site.ldap.persistence.exception.EntryPersistenceException)2 CustomEntry (org.xdi.ldap.model.CustomEntry)2 ParseException (java.text.ParseException)1 Calendar (java.util.Calendar)1 Date (java.util.Date)1 WebApplicationException (javax.ws.rs.WebApplicationException)1 JSONException (org.codehaus.jettison.json.JSONException)1 SearchScope (org.xdi.ldap.model.SearchScope)1 Scope (org.xdi.oxauth.model.common.Scope)1 SimpleUser (org.xdi.oxauth.model.common.SimpleUser)1