/** * Retrieves whether this property contains SAML Metadata * * * @param property * @return boolean * */ public boolean canHandle(Property property) { if (property != null) { String meta = property.getName(); if (meta != null && meta.contains(IDPMetadataConstant.SAML)) { if (property.getValue() != null && property.getValue().length() > 0){ return true; } return false; } else { return false; } } else { return false; } }
@Override public List<Property> getConfigurationProperties() { List<Property> configProperties = new ArrayList<Property>(); Property callbackUrl = new Property(); callbackUrl.setDisplayName("Callback Url"); callbackUrl.setName(IdentityApplicationConstants.OAuth2.CALLBACK_URL); callbackUrl.setDescription("Enter value corresponding to callback url."); callbackUrl.setDisplayOrder(3); configProperties.add(callbackUrl); Property clientId = new Property(); clientId.setName(OIDCAuthenticatorConstants.CLIENT_ID); clientId.setDisplayName("Client Id"); clientId.setRequired(true); clientId.setDescription("Enter Microsoft Live client identifier value"); clientId.setDisplayOrder(1); configProperties.add(clientId); Property clientSecret = new Property(); clientSecret.setName(OIDCAuthenticatorConstants.CLIENT_SECRET); clientSecret.setDisplayName("Client Secret"); clientSecret.setRequired(true); clientSecret.setConfidential(true); clientSecret.setDescription("Enter Microsoft Live client secret value"); clientSecret.setDisplayOrder(2); configProperties.add(clientSecret); return configProperties; }
@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}; }
/** * 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; }
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 prop = new Property(); prop.setName(propName); prop.setValue(propValue); if (isCustomAuthenticator && customAuthenticator != null) { Property mappedProperty = getMappedProperty(customAuthenticator, propName); if (mappedProperty != null) { prop.setDisplayName(mappedProperty.getDisplayName()); Map<String, Property> destinationMap = new HashMap<>(); for (Property destination : destinations) { destinationMap.put(destination.getName(), destination); Property property = destinationMap.get(source.getName()); if (property == null) { if (isCustomInboundAuthType(inboundAuthenticationRequestConfig.getInboundAuthType())) { if (inboundAuthenticatorConfig.isRelyingPartyKeyConfigured()) { if (StringUtils.equals(inboundAuthenticatorConfig.getRelyingPartyKey(), source .getName())) { source.setValue(inboundAuthenticationRequestConfig.getInboundAuthKey()); destinationMap.put(source.getName(), source); } else { property.setConfidential(source.isConfidential()); property.setDefaultValue(source.getDefaultValue()); property.setAdvanced(source.isAdvanced()); property.setDescription(source.getDescription()); property.setDisplayOrder(source.getDisplayOrder()); property.setRequired(source.isRequired()); property.setType(source.getType());
/** * 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()]); }
boolean propertyExists = false; for (Property property : properties) { if (connectorProperty.equals(property.getName())) { configProperties[j] = property; configProperties[j].setDisplayName(propertyFriendlyNames.get(configProperties[j].getName())); configProperties[j].setDescription(propertyDescriptions.get(configProperties[j].getName())); propertyExists = true; break; Property newProperty = new Property(); newProperty.setName(connectorProperty); newProperty.setDescription(list.get(i).getPropertyDescriptionMapping().get(connectorProperty)); newProperty.setDisplayName(list.get(i).getPropertyNameMapping().get(connectorProperty)); Properties defaultPropertyValues = list.get(i).getDefaultPropertyValues(tenantDomain); newProperty.setValue(String.valueOf(defaultPropertyValues.get(connectorProperty))); identityGovernanceService.updateConfiguration(tenantDomain, Collections.singletonMap(newProperty.getName(), newProperty.getValue())); configProperties[j] = newProperty;
Property prop = new Property(); prop.setName(propName); prop.setValue(propValue); if (isCustomAuthenticator) { if (customAuthenticator != null) { Property mappedProperty = getMappedProperty(customAuthenticator, propName); if (mappedProperty != null) { prop.setDisplayName(mappedProperty.getDisplayName()); prop.setType(mappedProperty.getType()); Map<String, Property> destinationMap = new HashMap<>(); for (Property destination : destinations) { destinationMap.put(destination.getName(), destination); Property property = destinationMap.get(source.getName()); if (property == null) { if (isCustomInboundAuthType(inboundAuthenticationRequestConfig.getInboundAuthType())) { if (inboundAuthenticatorConfig.isRelyingPartyKeyConfigured()) { if (inboundAuthenticatorConfig.getAuthKey() == null && inboundAuthenticatorConfig.getRelyingPartyKey().equals(source.getName())) { source.setValue(inboundAuthenticationRequestConfig.getInboundAuthKey()); destinationMap.put(source.getName(), source);
/** * Checks whether given property is not null and property value is not blank * @param property * @return boolean */ public boolean isValidPropertyValue (Property property){ return property != null && StringUtils.isNotBlank(property.getValue()); } }
Property Property = new Property(); String name = rs2.getString("PROPERTY_KEY"); String value = rs2.getString("PROPERTY_VALUE"); String isSecret = rs2.getString("IS_SECRET"); Property.setName(name); if (propertyType != null && IdentityApplicationConstants.ConfigElements. PROPERTY_TYPE_BLOB.equals(propertyType.trim())) { Property.setValue(blobValue); } else { Property.setValue(value); Property.setType(propertyType); Property.setConfidential(true); } else { Property.setConfidential(false);
public static Property getProperty(Property[] properties, String propertyName) { if (ArrayUtils.isEmpty(properties) || StringUtils.isBlank(propertyName)) { return null; } for (Property property : properties) { if (property == null) { continue; } if (propertyName.equals(property.getName())) { return property; } } return null; }
/** * 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; }
public ConnectorConfig[] getConnectorList() throws IdentityGovernanceException { String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(); identityGovernanceService = new IdentityGovernanceServiceImpl(); List<IdentityGovernanceConnector> list = IdentityMgtServiceDataHolder.getInstance() .getIdentityGovernanceConnectorList(); Property[] properties = identityGovernanceService.getConfiguration(tenantDomain); ConnectorConfig[] configs = new ConnectorConfig[list.size()]; String[] connectorProperties; for (int i=0; i<list.size();i++) { ConnectorConfig config =new ConnectorConfig(); Map <String,String> friendlyNames = list.get(i).getPropertyNameMapping(); config.setFriendlyName(list.get(i).getFriendlyName()); connectorProperties = list.get(i).getPropertyNames(); Property[] configProperties = new Property[connectorProperties.length]; for (int j=0; j<connectorProperties.length;j++) { for (int k = 0; k < properties.length; k++) { if (connectorProperties[j].equals(properties[k].getName())) { configProperties[j] = properties[k]; configProperties[j].setDisplayName(friendlyNames.get(configProperties[j].getName())); break; } } } config.setProperties(configProperties); configs[i] = config; } return configs; }
/** * Populates the SCIM Provider. * * @param property * @param scimPropertyName * @throws IdentityProvisioningException */ private void populateSCIMProvider(Property property, String scimPropertyName) throws IdentityProvisioningException { if (StringUtils.isNotEmpty(property.getValue())) { scimProvider.setProperty(scimPropertyName, property.getValue()); } else if (StringUtils.isNotEmpty(property.getDefaultValue())) { scimProvider.setProperty(scimPropertyName, property.getDefaultValue()); } }
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; }
if (property == null || StringUtils.isBlank(property.getName()) || StringUtils.isBlank(property.getValue())) { continue; if (property.getName().contains(IdentityApplicationConstants.PASSWORD)) { for (RandomPassword randomPassword : randomPasswords) { if (property.getName().equals(randomPassword.getPropertyName())) { if (property.getValue().equals(randomPassword.getRandomPhrase())) { if (log.isDebugEnabled()){ log.debug("User didn't changed password property: " + property.getName() + " hence replace Random Password with Original Password"); property.setValue(randomPassword.getPassword());
Set<Property> properties = new HashSet<Property>(); while (proprs.next()) { Property property = new Property(); property.setName(proprs.getString("PROPERTY_KEY")); property.setValue(proprs.getString("PROPERTY_VALUE")); if ((IdPManagementConstants.IS_TRUE_VALUE).equals(proprs.getString("IS_SECRET"))) { property.setConfidential(true);
public static Property getProperty(Property[] properties, String propertyName) { if (ArrayUtils.isEmpty(properties) || StringUtils.isBlank(propertyName)) { return null; } for (Property property : properties) { if (property == null) { continue; } if (propertyName.equals(property.getName())) { return property; } } return null; }