private Property[] addUniqueIdProperty(Property [] properties) { if (ArrayUtils.isEmpty(properties)){ return new Property[0]; } String uuid = UUID.randomUUID().toString(); Property uniqueIdProperty = new Property(); uniqueIdProperty.setName(IdentityApplicationConstants.UNIQUE_ID_CONSTANT); uniqueIdProperty.setValue(uuid); if (log.isDebugEnabled()){ log.debug("Adding uniqueId property: " + uuid); } properties = (Property[]) ArrayUtils.add(properties, uniqueIdProperty); return properties; }
private Property[] addUniqueIdProperty(Property [] properties) { if (ArrayUtils.isEmpty(properties)){ return new Property[0]; } String uuid = UUID.randomUUID().toString(); Property uniqueIdProperty = new Property(); uniqueIdProperty.setName(IdentityApplicationConstants.UNIQUE_ID_CONSTANT); uniqueIdProperty.setValue(uuid); if (log.isDebugEnabled()){ log.debug("Adding uniqueId property: " + uuid); } properties = (Property[]) ArrayUtils.add(properties, uniqueIdProperty); return properties; }
property.setName(element.getText()); } else if ("Value".equals(elementName)) { property.setValue(element.getText()); } else if ("IsConfidential".equals(elementName)) { if (element.getText() != null && element.getText().trim().length() > 0) {
property.setName(element.getText()); } else if ("Value".equals(elementName)) { property.setValue(element.getText()); } else if ("IsConfidential".equals(elementName)) { if (element.getText() != null && element.getText().trim().length() > 0) {
/** * Get Configuration Properties * * @return */ @Override public List<Property> getConfigurationProperties() { List<Property> configProperties = new ArrayList<Property>(); Property oauthEndpoint = new Property(); oauthEndpoint.setDisplayName("Yahoo Authentication Endpoint"); oauthEndpoint.setName(YahooOpenIDAuthenticatorConstants.YAHOO_AUTHZ_URL); oauthEndpoint.setValue(IdentityApplicationConstants.YAHOO_AUTHZ_URL); oauthEndpoint.setDescription("Enter value corresponding to yahoo oauth endpoint."); oauthEndpoint.setDisplayOrder(1); configProperties.add(oauthEndpoint); return configProperties; }
" hence replace Random Password with Original Password"); property.setValue(randomPassword.getPassword());
" hence replace Random Password with Original Password"); property.setValue(randomPassword.getPassword());
/** * Replace original passwords with provided random phrase * @param randomPhrase * @param properties * @return */ private RandomPassword[] replaceOriginalPasswordsWithRandomPasswords(String randomPhrase, Property[] properties) { ArrayList<RandomPassword> randomPasswordArrayList = new ArrayList<RandomPassword>(); if (properties != null) { for (Property property : properties) { if (property == null || property.getName() == null || property.getValue() == null) { continue; } if (property.getName().contains(IdentityApplicationConstants.PASSWORD)) { if (log.isDebugEnabled()){ log.debug("Found Password Property :" + property.getValue()); } RandomPassword randomPassword = new RandomPassword(); randomPassword.setPropertyName(property.getName()); randomPassword.setPassword(property.getValue()); randomPassword.setRandomPhrase(randomPhrase); randomPasswordArrayList.add(randomPassword); property.setValue(randomPhrase); } } } return randomPasswordArrayList.toArray(new RandomPassword[randomPasswordArrayList.size()]); }
/** * Replace original passwords with provided random phrase * @param randomPhrase * @param properties * @return */ private RandomPassword[] replaceOriginalPasswordsWithRandomPasswords(String randomPhrase, Property[] properties) { ArrayList<RandomPassword> randomPasswordArrayList = new ArrayList<RandomPassword>(); if (properties != null) { for (Property property : properties) { if (property == null || property.getName() == null || property.getValue() == null) { continue; } if (property.getName().contains(IdentityApplicationConstants.PASSWORD)) { if (log.isDebugEnabled()){ log.debug("Found Password Property :" + property.getValue()); } RandomPassword randomPassword = new RandomPassword(); randomPassword.setPropertyName(property.getName()); randomPassword.setPassword(property.getValue()); randomPassword.setRandomPhrase(randomPhrase); randomPasswordArrayList.add(randomPassword); property.setValue(randomPhrase); } } } return randomPasswordArrayList.toArray(new RandomPassword[randomPasswordArrayList.size()]); }
/** * Updates the property values of the given property name of the given authenticator. * * @param residentIdentityProvider * @param authenticatorName * @param propertyName * @param newValue * @return true if the value was updated, false if the value is up to date. */ private boolean updateFederationAuthenticationConfigProperty(IdentityProvider residentIdentityProvider, String authenticatorName, String propertyName, String newValue) { FederatedAuthenticatorConfig federatedAuthenticatorConfig = IdentityApplicationManagementUtil .getFederatedAuthenticator(residentIdentityProvider.getFederatedAuthenticatorConfigs(), authenticatorName); if (federatedAuthenticatorConfig != null) { Property existingProperty = IdentityApplicationManagementUtil.getProperty(federatedAuthenticatorConfig .getProperties(), propertyName); if (existingProperty != null) { String existingPropertyValue = existingProperty.getValue(); if (!StringUtils.equalsIgnoreCase(existingPropertyValue, newValue)) { existingProperty.setValue(newValue); return true; } } } return false; }
/** * Get the configurations of a tenant from cache or database * * @param tenantDomain Domain name of the tenant * @return Configurations belong to the tenant */ private static Property[] getResidentIdpConfiguration(String tenantDomain) throws FrameworkException { IdpManager identityProviderManager = IdentityProviderManager.getInstance(); IdentityProvider residentIdp = null; try { residentIdp = identityProviderManager.getResidentIdP(tenantDomain); } catch (IdentityProviderManagementException e) { String errorMsg = String.format("Error while retrieving resident Idp for %s tenant.", tenantDomain); throw new FrameworkException(errorMsg, e); } IdentityProviderProperty[] identityMgtProperties = residentIdp.getIdpProperties(); Property[] configMap = new Property[identityMgtProperties.length]; int index = 0; for (IdentityProviderProperty identityMgtProperty : identityMgtProperties) { if (ALREADY_WRITTEN_PROPERTY.equals(identityMgtProperty.getName())) { continue; } Property property = new Property(); property.setName(identityMgtProperty.getName()); property.setValue(identityMgtProperty.getValue()); configMap[index] = property; index++; } return configMap; }
/** * Get the configurations of a tenant from cache or database * * @param tenantDomain Domain name of the tenant * @return Configurations belong to the tenant */ private static Property[] getResidentIdpConfiguration(String tenantDomain) throws FrameworkException { IdpManager identityProviderManager = IdentityProviderManager.getInstance(); IdentityProvider residentIdp = null; try { residentIdp = identityProviderManager.getResidentIdP(tenantDomain); } catch (IdentityProviderManagementException e) { String errorMsg = String.format("Error while retrieving resident Idp for %s tenant.", tenantDomain); throw new FrameworkException(errorMsg, e); } IdentityProviderProperty[] identityMgtProperties = residentIdp.getIdpProperties(); Property[] configMap = new Property[identityMgtProperties.length]; int index = 0; for (IdentityProviderProperty identityMgtProperty : identityMgtProperties) { if (ALREADY_WRITTEN_PROPERTY.equals(identityMgtProperty.getName())) { continue; } Property property = new Property(); property.setName(identityMgtProperty.getName()); property.setValue(identityMgtProperty.getValue()); configMap[index] = property; index++; } return configMap; }
@Override public Property[] getConfigurationProperties() { Property appType = new Property(); appType.setName(IdentityConstants.ServerConfig.WELLKNOWN_APPLICATION_TYPE); appType.setType("hidden"); appType.setValue(getConfigName()); appType.setDisplayName(IdentityConstants.ServerConfig.WELLKNOWN_APPLICATION_TYPE); Property service = new Property(); service.setName(CASSSOConstants.SERVICE_PROVIDER_ARGUMENT); service.setDisplayName(CASSSOConstants.CAS_SERVICE_URL); return new Property[]{appType, service}; }
property.setValue(identityMgtProperty.getValue()); configMap[index] = property; index++;
property.setValue(identityMgtProperty.getValue()); configMap[index] = property; index++;
Property handlerProperty = new Property(); handlerProperty.setName(IS_HANDLER); handlerProperty.setValue(TRUE); configurationProperties.add(handlerProperty);
scope.setDisplayName("Additional Query Parameters"); scope.setName("AdditionalQueryParameters"); scope.setValue("scope=openid email profile"); scope.setDescription("Additional query parameters. e.g: paramName1=value1"); scope.setDisplayOrder(4);
scope.setDisplayName("Additional Query Parameters"); scope.setName("AdditionalQueryParameters"); scope.setValue("scope=openid email profile"); scope.setDescription("Additional query parameters. e.g: paramName1=value1"); scope.setDisplayOrder(4);
Property property = new Property(); property.setName(OAUTH2_CONSUMER_SECRET); property.setValue(getClientSecret(inboundRequestConfig.getInboundAuthKey())); props = (Property[]) ArrayUtils.add(props, property); inboundRequestConfig.setProperties(props);
Property property = new Property(); property.setName(OAUTH2_CONSUMER_SECRET); property.setValue(getClientSecret(inboundRequestConfig.getInboundAuthKey())); props = (Property[]) ArrayUtils.add(props, property); inboundRequestConfig.setProperties(props);