protected DuoSecurityUserAccount mapDuoSecurityUserAccount(final JSONObject userJson) throws JSONException {
        val user = new DuoSecurityUserAccount(userJson.getString("username"));
        user.setUserId(userJson.getString("user_id"));
        user.setStatus(DuoSecurityUserAccountStatus.from(userJson.getString("status")));

        collectDuoSecurityUserAccountAttribute(userJson, "email", user);
        collectDuoSecurityUserAccountAttribute(userJson, "user_id", user);
        collectDuoSecurityUserAccountAttribute(userJson, "firstname", user);
        collectDuoSecurityUserAccountAttribute(userJson, "lastname", user);
        collectDuoSecurityUserAccountAttribute(userJson, "realname", user);
        collectDuoSecurityUserAccountAttribute(userJson, "is_enrolled", user);
        collectDuoSecurityUserAccountAttribute(userJson, "last_login", user);
        collectDuoSecurityUserAccountAttribute(userJson, "created", user);
        collectDuoSecurityUserAccountAttribute(userJson, "alias1", user);
        collectDuoSecurityUserAccountAttribute(userJson, "alias2", user);
        collectDuoSecurityUserAccountAttribute(userJson, "notes", user);
        collectDuoSecurityUserAccountAttribute(userJson, "lockout_reason", user);

        if (user.getStatus() != DuoSecurityUserAccountStatus.DENY && !user.isEnrolled()) {
            user.setStatus(DuoSecurityUserAccountStatus.ENROLL);
        }
        user.setProviderId(duoProperties.getId());
        mapUserPhones(userJson, user);
        mapUserGroups(userJson, user);
        return user;
    }
This is {@link DefaultDuoSecurityAdminApiService}.

@author Misagh Moayyed
@since 6.4.0
support/cas-server-support-duo-core/src/main/java/org/apereo/cas/adaptors/duo/authn/DefaultDuoSecurityAdminApiService.java