Java Code Examples for org.gluu.util.StringHelper#equalsIgnoreCase()
The following examples show how to use
org.gluu.util.StringHelper#equalsIgnoreCase() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AttributeService.java From oxTrust with MIT License | 6 votes |
/** * Get all organization attributes * * @param attributes * List of attributes * @return List of organization attributes */ private List<GluuAttribute> getAllPersonAtributesImpl(GluuUserRole gluuUserRole, Collection<GluuAttribute> attributes) { List<GluuAttribute> attributeList = new ArrayList<GluuAttribute>(); String[] objectClassTypes = appConfiguration.getPersonObjectClassTypes(); log.debug("objectClassTypes={}", Arrays.toString(objectClassTypes)); for (GluuAttribute attribute : attributes) { if (StringHelper.equalsIgnoreCase(attribute.getOrigin(), appConfiguration.getPersonCustomObjectClass()) && (GluuUserRole.ADMIN == gluuUserRole)) { attribute.setCustom(true); attributeList.add(attribute); continue; } for (String objectClassType : objectClassTypes) { if (attribute.getOrigin().equals(objectClassType) && ((attribute.allowViewBy(gluuUserRole) || attribute.allowEditBy(gluuUserRole)))) { attributeList.add(attribute); break; } } } return attributeList; }
Example 2
Source File: AttributeService.java From oxTrust with MIT License | 6 votes |
private List<GluuAttribute> getAllPersonAtributes(GluuUserRole gluuUserRole, Collection<GluuAttribute> attributes) { List<GluuAttribute> attributeList = new ArrayList<GluuAttribute>(); String[] objectClassTypes = appConfiguration.getPersonObjectClassTypes(); log.debug("objectClassTypes={}", Arrays.toString(objectClassTypes)); for (GluuAttribute attribute : attributes) { if (StringHelper.equalsIgnoreCase(attribute.getOrigin(), appConfiguration.getPersonCustomObjectClass()) && (GluuUserRole.ADMIN == gluuUserRole)) { attribute.setCustom(true); attributeList.add(attribute); continue; } for (String objectClassType : objectClassTypes) { if (attribute.getOrigin().equals(objectClassType)) { attributeList.add(attribute); break; } } } return attributeList; }
Example 3
Source File: Configuration.java From oxTrust with MIT License | 6 votes |
public String getPropertyValue(String propertyName) { if (StringHelper.equalsIgnoreCase(Configuration.OAUTH_PROPERTY_AUTHORIZE_URL, propertyName)) { return openIdConfiguration.getAuthorizationEndpoint(); } else if (StringHelper.equalsIgnoreCase(Configuration.OAUTH_PROPERTY_TOKEN_URL, propertyName)) { return openIdConfiguration.getTokenEndpoint(); } else if (StringHelper.equalsIgnoreCase(Configuration.OAUTH_PROPERTY_USERINFO_URL, propertyName)) { return openIdConfiguration.getUserInfoEndpoint(); } else if (StringHelper.equalsIgnoreCase(Configuration.OAUTH_PROPERTY_LOGOUT_URL, propertyName)) { return openIdConfiguration.getEndSessionEndpoint(); } else if (StringHelper.equalsIgnoreCase(Configuration.OAUTH_PROPERTY_LOGOUT_REDIRECT_URL, propertyName)) { return appConfiguration.getOpenIdPostLogoutRedirectUri(); } else if (StringHelper.equalsIgnoreCase(Configuration.OAUTH_PROPERTY_CLIENT_ID, propertyName)) { return appConfiguration.getOpenIdClientId(); } else if (StringHelper.equalsIgnoreCase(Configuration.OAUTH_PROPERTY_CLIENT_PASSWORD, propertyName)) { return appConfiguration.getOpenIdClientPassword(); } else if (StringHelper.equalsIgnoreCase(Configuration.OAUTH_PROPERTY_CLIENT_SCOPE, propertyName)) { return Util.listAsString(appConfiguration.getOpenIdScopes()); } return null; }
Example 4
Source File: UserService.java From oxAuth with MIT License | 6 votes |
public String getUserInumByDn(String dn) { if (StringHelper.isEmpty(dn)) { return null; } String peopleDn = getPeopleBaseDn(); if (!dn.toLowerCase().endsWith(peopleDn.toLowerCase())) { return null; } String firstDnPart = dn.substring(0, dn.length() - peopleDn.length()); String[] dnParts = firstDnPart.split(","); if (dnParts.length == 0) { return null; } String userInumPart = dnParts[dnParts.length - 1]; String[] userInumParts = userInumPart.split("="); if ((userInumParts.length == 2) && StringHelper.equalsIgnoreCase(userInumParts[0], "inum")) { return userInumParts[1]; } return null; }
Example 5
Source File: UpdateTrustRelationshipAction.java From oxTrust with MIT License | 6 votes |
private boolean initActions() { initAttributes(this.trustRelationship); String resultInitContacts = trustContactsAction.initContacts(this.trustRelationship); if (!StringHelper.equalsIgnoreCase(OxTrustConstants.RESULT_SUCCESS, resultInitContacts)) { return false; } String resultInitMetadataFilters = metadataFiltersAction.initMetadataFilters(this.trustRelationship); if (!StringHelper.equalsIgnoreCase(OxTrustConstants.RESULT_SUCCESS, resultInitMetadataFilters)) { return false; } String resultInitProfileConfigurations = relyingPartyAction.initProfileConfigurations(); if (!StringHelper.equalsIgnoreCase(OxTrustConstants.RESULT_SUCCESS, resultInitProfileConfigurations)) { return false; } String resultInitFederationDeconstructions = federationDeconstructionAction .initFederationDeconstructions(this.trustRelationship); if (!StringHelper.equalsIgnoreCase(OxTrustConstants.RESULT_SUCCESS, resultInitFederationDeconstructions)) { return false; } initFederatedSites(this.trustRelationship); return true; }
Example 6
Source File: ExternalAuthenticationService.java From oxAuth with MIT License | 5 votes |
public CustomScriptConfiguration determineCustomScriptConfiguration(AuthenticationScriptUsageType usageType, List<String> acrValues) { List<String> authModes = getAuthModesByAcrValues(acrValues); if (authModes.size() > 0) { for (String authMode : authModes) { for (CustomScriptConfiguration customScriptConfiguration : this.customScriptConfigurationsMapByUsageType.get(usageType)) { if (StringHelper.equalsIgnoreCase(authMode, customScriptConfiguration.getName())) { return customScriptConfiguration; } } } } return null; }
Example 7
Source File: UserService.java From oxAuth with MIT License | 5 votes |
public CustomAttribute getCustomAttribute(User user, String attributeName) { for (CustomAttribute customAttribute : user.getCustomAttributes()) { if (StringHelper.equalsIgnoreCase(attributeName, customAttribute.getName())) { return customAttribute; } } return null; }
Example 8
Source File: BenchmarkTestListener.java From oxAuth with MIT License | 5 votes |
private long getMethodThreqads(ITestContext context, String methodName) { ITestNGMethod[] allTestMethods = context.getAllTestMethods(); for (int i = 0; i < allTestMethods.length; i++) { if (StringHelper.equalsIgnoreCase(allTestMethods[i].getMethodName(), methodName)) { return allTestMethods[i].getThreadPoolSize(); } } return 1; }
Example 9
Source File: ClientService.java From oxAuth with MIT License | 5 votes |
public org.gluu.persist.model.base.CustomAttribute getCustomAttribute(Client client, String attributeName) { for (org.gluu.persist.model.base.CustomAttribute customAttribute : client.getCustomAttributes()) { if (StringHelper.equalsIgnoreCase(attributeName, customAttribute.getName())) { return customAttribute; } } return null; }
Example 10
Source File: ExternalAuthenticationService.java From oxAuth with MIT License | 5 votes |
public CustomScriptConfiguration getCustomScriptConfigurationByName(String name) { for (Entry<String, CustomScriptConfiguration> customScriptConfigurationEntry : this.customScriptConfigurationsNameMap.entrySet()) { if (StringHelper.equalsIgnoreCase(scriptName(name), customScriptConfigurationEntry.getKey())) { return customScriptConfigurationEntry.getValue(); } } return null; }
Example 11
Source File: CustomAttributeAction.java From oxTrust with MIT License | 5 votes |
public GluuAttribute getCustomAttribute(String origin, String name) { List<GluuAttribute> originAttributes = attributeByOrigin.get(origin); if (originAttributes == null) { return null; } for (GluuAttribute attribute : originAttributes) { if (StringHelper.equalsIgnoreCase(attribute.getName(), name)) { return attribute; } } return null; }
Example 12
Source File: MetadataFiltersAction.java From oxTrust with MIT License | 5 votes |
public MetadataFilter getMetadataFilter(String metadataFilterName) { if (this.availableMetadataFilters == null) { return null; } for (MetadataFilter metadataFilter : this.availableMetadataFilters) { if (StringHelper.equalsIgnoreCase(metadataFilter.getName(), metadataFilterName)) { return metadataFilter; } } return null; }
Example 13
Source File: RegisterRestWebServiceImpl.java From oxAuth with MIT License | 5 votes |
private boolean processApplicationAttributes(Client p_client, String attr, final List<String> parameterValues) { if (StringHelper.equalsIgnoreCase("oxAuthTrustedClient", attr)) { boolean trustedClient = StringHelper.toBoolean(parameterValues.get(0), false); p_client.setTrustedClient(trustedClient); return true; } else if (StringHelper.equalsIgnoreCase("oxIncludeClaimsInIdToken", attr)) { boolean includeClaimsInIdToken = StringHelper.toBoolean(parameterValues.get(0), false); p_client.setIncludeClaimsInIdToken(includeClaimsInIdToken); return true; } return false; }
Example 14
Source File: RelyingPartyAction.java From oxTrust with MIT License | 5 votes |
public String saveFilters() { updateProfileConfigurations(); profileConfigurationService.saveProfileConfigurations(trustRelationship, fileWrappers); profileConfigurations = null; String resultInitProfileConfigurations = initProfileConfigurations(); if (!StringHelper.equalsIgnoreCase(OxTrustConstants.RESULT_SUCCESS, resultInitProfileConfigurations)) { return OxTrustConstants.RESULT_FAILURE; } return OxTrustConstants.RESULT_SUCCESS; }
Example 15
Source File: MemberService.java From oxTrust with MIT License | 5 votes |
public void removePerson(GluuCustomPerson person) { // Remove groups where user is owner List<GluuGroup> groups = groupService.getAllGroups(); for (GluuGroup group : groups) { if (StringHelper.equalsIgnoreCase(group.getOwner(), person.getDn())) { groupService.removeGroup(group); } } // Remove person from associated groups removePersonFromGroups(person); // Remove person personService.removePerson(person); }
Example 16
Source File: ExternalAuthenticationService.java From oxAuth with MIT License | 5 votes |
public CustomScriptConfiguration getCustomScriptConfiguration(AuthenticationScriptUsageType usageType, String name) { for (CustomScriptConfiguration customScriptConfiguration : this.customScriptConfigurationsMapByUsageType.get(usageType)) { if (StringHelper.equalsIgnoreCase(scriptName(name), customScriptConfiguration.getName())) { return customScriptConfiguration; } } return null; }
Example 17
Source File: LdapCustomAuthenticationConfigurationService.java From oxAuth with MIT License | 5 votes |
private CustomAuthenticationConfiguration mapCustomAuthentication(oxIDPAuthConf oneConf) { CustomAuthenticationConfiguration customAuthenticationConfig = new CustomAuthenticationConfiguration(); customAuthenticationConfig.setName(oneConf.getName()); customAuthenticationConfig.setLevel(oneConf.getLevel()); customAuthenticationConfig.setPriority(oneConf.getPriority()); customAuthenticationConfig.setEnabled(oneConf.getEnabled()); customAuthenticationConfig.setVersion(oneConf.getVersion()); for (CustomProperty customProperty : oneConf.getFields()) { if ((customProperty.getValues() == null) || (customProperty.getValues().size() == 0)) { continue; } String attrName = StringHelper.toLowerCase(customProperty.getName()); if (StringHelper.isEmpty(attrName)) { continue; } String value = customProperty.getValues().get(0); if (attrName.startsWith(CUSTOM_AUTHENTICATION_PROPERTY_PREFIX)) { String key = customProperty.getName().substring(CUSTOM_AUTHENTICATION_PROPERTY_PREFIX.length()); SimpleCustomProperty property = new SimpleCustomProperty(key, value); customAuthenticationConfig.getCustomAuthenticationAttributes().add(property); } else if (StringHelper.equalsIgnoreCase(attrName, CUSTOM_AUTHENTICATION_SCRIPT_PROPERTY_NAME)) { customAuthenticationConfig.setCustomAuthenticationScript(value); } else if (StringHelper.equalsIgnoreCase(attrName, CUSTOM_AUTHENTICATION_SCRIPT_USAGE_TYPE)) { if (StringHelper.isNotEmpty(value)) { AuthenticationScriptUsageType authenticationScriptUsageType = AuthenticationScriptUsageType.getByValue(value); customAuthenticationConfig.setUsageType(authenticationScriptUsageType); } } } return customAuthenticationConfig; }
Example 18
Source File: CustomEntry.java From oxTrust with MIT License | 5 votes |
public String getAttribute(String attributeName) { if (StringHelper.isEmpty(attributeName)) { return null; } String value = null; for (GluuCustomAttribute attribute : getCustomAttributes()) { if (StringHelper.equalsIgnoreCase(attribute.getName(), attributeName)) { value = attribute.getValue(); break; } } return value; }
Example 19
Source File: PasswordResetAction.java From oxTrust with MIT License | 4 votes |
public String start() throws ParseException { if (StringHelper.isEmpty(guid)) { sendExpirationError(); return OxTrustConstants.RESULT_FAILURE; } setCode(guid); PasswordResetRequest passwordResetRequest; try { passwordResetRequest = passwordResetService.findPasswordResetRequest(getGuid()); } catch (EntryPersistenceException ex) { log.error("Failed to find password reset request by '{}'", guid, ex); sendExpirationError(); return OxTrustConstants.RESULT_FAILURE; } if (passwordResetRequest == null) { sendExpirationError(); return OxTrustConstants.RESULT_FAILURE; } PasswordResetRequest personPasswordResetRequest = passwordResetService .findActualPasswordResetRequest(passwordResetRequest.getPersonInum()); if (personPasswordResetRequest == null) { sendExpirationError(); return OxTrustConstants.RESULT_FAILURE; } if (!StringHelper.equalsIgnoreCase(guid, personPasswordResetRequest.getOxGuid())) { sendExpirationError(); return OxTrustConstants.RESULT_FAILURE; } this.request = personPasswordResetRequest; Calendar requestCalendarExpiry = new GregorianCalendar(TimeZone.getTimeZone("UTC")); Calendar currentCalendar = new GregorianCalendar(TimeZone.getTimeZone("UTC")); if (request != null) { requestCalendarExpiry.setTime(request.getCreationDate()); } currentCalendar.add(Calendar.SECOND, -appConfiguration.getPasswordResetRequestExpirationTime()); GluuCustomPerson person = personService.getPersonByInum(request.getPersonInum()); GluuCustomAttribute question = null; if (person != null) { question = person.getGluuCustomAttribute("secretQuestion"); } if ((request != null) && requestCalendarExpiry.after(currentCalendar)) { if (question != null) { securityQuestion = question.getValue(); } return OxTrustConstants.RESULT_SUCCESS; } else { facesMessages.add(FacesMessage.SEVERITY_ERROR, "Your link is not valid or your user is not allowed to perform a password reset. If you want to initiate a reset password procedure please fill this form."); conversationService.endConversation(); return OxTrustConstants.RESULT_FAILURE; } }
Example 20
Source File: ConfigurationFactory.java From oxTrust with MIT License | 4 votes |
private void reloadConfiguration() { // Reload LDAP configuration if needed PersistenceConfiguration newPersistenceConfiguration = persistanceFactoryService .loadPersistenceConfiguration(getApplicationPropertiesFileName()); if (newPersistenceConfiguration != null) { if (!StringHelper.equalsIgnoreCase(this.persistenceConfiguration.getFileName(), newPersistenceConfiguration.getFileName()) || (newPersistenceConfiguration.getLastModifiedTime() > this.persistenceConfiguration .getLastModifiedTime())) { // Reload configuration only if it was modified this.persistenceConfiguration = newPersistenceConfiguration; event.select(LdapConfigurationReload.Literal.INSTANCE).fire(PERSISTENCE_CONFIGUARION_RELOAD_EVENT_TYPE); } } // Reload Base configuration if needed File baseConfiguration = new File(BASE_PROPERTIES_FILE); if (baseConfiguration.exists()) { final long lastModified = baseConfiguration.lastModified(); if (lastModified > baseConfigurationFileLastModifiedTime) { // Reload configuration only if it was modified loadBaseConfiguration(); event.select(BaseConfigurationReload.Literal.INSTANCE).fire(BASE_CONFIGUARION_RELOAD_EVENT_TYPE); } } if (!loadedFromLdap) { return; } final C conf = loadConfigurationFromDb("oxRevision"); if (conf == null) { return; } if (!isNewRevision(conf)) { return; } createFromDb(); }