org.wso2.carbon.identity.application.common.model.Property类的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(14.4k)|赞(0)|评价(0)|浏览(99)

本文整理了Java中org.wso2.carbon.identity.application.common.model.Property类的一些代码示例,展示了Property类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Property类的具体详情如下:
包路径:org.wso2.carbon.identity.application.common.model.Property
类名称:Property

Property介绍

暂无

代码示例

代码示例来源:origin: org.wso2.carbon.identity.metadata.saml2/org.wso2.carbon.identity.outbound.metadata.saml2

/**
 * 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;
  }
}

代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.application.authenticator.live

@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;
}

代码示例来源:origin: org.wso2.carbon.extension.identity.authenticator/org.wso2.carbon.extension.identity.sso.cas

@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};
}

代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.application.authenticator.social

/**
 * 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;
}

代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.application.common

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;
}

代码示例来源:origin: wso2/carbon-identity-framework

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());

代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.application.common

/**
 * 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()]);
}

代码示例来源:origin: org.wso2.carbon.identity.governance/org.wso2.carbon.identity.governance

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;

代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.application.mgt

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);

代码示例来源:origin: wso2/carbon-identity-framework

/**
   * 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());
  }
}

代码示例来源:origin: wso2/carbon-identity-framework

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);

代码示例来源:origin: wso2/carbon-identity-framework

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;
}

代码示例来源:origin: wso2/carbon-identity-framework

/**
 * 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;
}

代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.governance

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;
}

代码示例来源:origin: org.wso2.carbon.identity.outbound.provisioning.scim2/org.wso2.carbon.identity.provisioning.connector.scim2

/**
 * 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());
  }
}

代码示例来源:origin: wso2/carbon-identity-framework

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;
}

代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.application.common

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());

代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.application.common

public static String getPropertyValue(Property[] properties, String propertyName) {

    Property property = getProperty(properties, propertyName);
    if (property != null) {
      if (StringUtils.isNotBlank(property.getValue())) {
        return property.getValue();
      }
    }
    return null;
  }
}

代码示例来源:origin: wso2/carbon-identity-framework

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);

代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.application.common

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;
}

相关文章