Examples of SecurityConfiguration


Examples of org.glassfish.security.services.config.SecurityConfiguration

            final Domain domain,
            final String serviceName,
            final String providerName,
            final ActionReport report) {
        // Get the security provider config
        final SecurityConfiguration sc = findSecurityConfiguration(domain, serviceName, report);
        if (sc == null) {
            return null;
        }
        SecurityProvider provider = sc.getSecurityProviderByName(providerName);
        if (provider == null) {
            report.setMessage("Unable to locate security provider: " + providerName);
            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            return null;
        }
View Full Code Here

Examples of org.opensaml.xml.security.SecurityConfiguration

     * @throws MessageEncodingException thrown if the algorithm URI could not be derived from the supplied credential
     */
    protected String getSignatureAlgorithmURI(Credential credential, SecurityConfiguration config)
            throws MessageEncodingException {

        SecurityConfiguration secConfig;
        if (config != null) {
            secConfig = config;
        } else {
            secConfig = Configuration.getGlobalSecurityConfiguration();
        }

        String signAlgo = secConfig.getSignatureAlgorithmURI(credential);

        if (signAlgo == null) {
            throw new MessageEncodingException("The signing credential's algorithm URI could not be derived");
        }

View Full Code Here

Examples of org.opensaml.xml.security.SecurityConfiguration

     * @throws MessageEncodingException thrown if the algorithm URI could not be derived from the supplied credential
     */
    protected String getSignatureAlgorithmURI(Credential credential, SecurityConfiguration config)
            throws MessageEncodingException {

        SecurityConfiguration secConfig;
        if (config != null) {
            secConfig = config;
        } else {
            secConfig = Configuration.getGlobalSecurityConfiguration();
        }

        String signAlgo = secConfig.getSignatureAlgorithmURI(credential);

        if (signAlgo == null) {
            throw new MessageEncodingException("The signing credential's algorithm URI could not be derived");
        }

View Full Code Here

Examples of org.opensaml.xml.security.SecurityConfiguration

     * @throws MessageEncodingException thrown if the algorithm URI could not be derived from the supplied credential
     */
    protected String getSignatureAlgorithmURI(Credential credential, SecurityConfiguration config)
            throws MessageEncodingException {

        SecurityConfiguration secConfig;
        if (config != null) {
            secConfig = config;
        } else {
            secConfig = Configuration.getGlobalSecurityConfiguration();
        }

        String signAlgo = secConfig.getSignatureAlgorithmURI(credential);

        if (signAlgo == null) {
            throw new MessageEncodingException("The signing credential's algorithm URI could not be derived");
        }

View Full Code Here

Examples of org.opensaml.xml.security.SecurityConfiguration

     * @throws MessageEncodingException thrown if the algorithm URI could not be derived from the supplied credential
     */
    protected String getSignatureAlgorithmURI(Credential credential, SecurityConfiguration config)
            throws MessageEncodingException {

        SecurityConfiguration secConfig;
        if (config != null) {
            secConfig = config;
        } else {
            secConfig = Configuration.getGlobalSecurityConfiguration();
        }

        String signAlgo = secConfig.getSignatureAlgorithmURI(credential);

        if (signAlgo == null) {
            throw new MessageEncodingException("The signing credential's algorithm URI could not be derived");
        }

View Full Code Here

Examples of org.sonatype.security.configuration.model.SecurityConfiguration

      throw new ConfigurationException("Could not upgrade Security configuration! Please replace the "
          + file.getAbsolutePath() + " file with a valid Security configuration file.");
    }

    // Need to decrypt the anonymous user's password
    SecurityConfiguration configuration = this.getConfiguration();
    if (StringUtils.isNotEmpty(configuration.getAnonymousPassword())) {
      String encryptedPassword = configuration.getAnonymousPassword();
      try {
        configuration.setAnonymousPassword(this.passwordHelper.decrypt(encryptedPassword));
      }
      catch (Exception e) {
        this.getLogger().error(
            "Failed to decrypt anonymous user's password in security-configuration.xml, password might be encrypted in memory.",
            e);
View Full Code Here

Examples of org.sonatype.security.configuration.model.SecurityConfiguration

      fis = new FileInputStream(file);

      loadConfiguration(fis);

      // decrypte the anon users password
      SecurityConfiguration configuration = this.getConfiguration();
      if (configuration != null && StringUtils.isNotEmpty(configuration.getAnonymousPassword())) {
        String encryptedPassword = configuration.getAnonymousPassword();
        try {
          configuration.setAnonymousPassword(this.passwordHelper.decrypt(encryptedPassword));
        }
        catch (Exception e) {
          this.getLogger().error(
              "Failed to decrypt anonymous user's password in security-configuration.xml, password might be encrypted in memory.",
              e);
View Full Code Here

Examples of org.sonatype.security.configuration.model.SecurityConfiguration

              + "******************************************************************************";
      getLogger().error(message);
      throw new IOException("Could not create configuration file " + file.getAbsolutePath(), e);
    }

    final SecurityConfiguration configuration = getConfiguration();
    checkNotNull(configuration, "Missing security configuration");
    // store clear text password, as we have to encrypt the persisted password
    final String clearPassword = configuration.getAnonymousPassword();
    try {
      configuration.setAnonymousPassword(passwordHelper.encrypt(clearPassword));
    }
    catch (Exception e) {
      getLogger().warn(
          "Failed to encrypt the anonymous users password, storing configuration with cleartext password!", e);
    }

    try {
      // perform the "safe save"
      getLogger().debug("Saving configuration: {}", file);
      final FileReplacer fileReplacer = new FileReplacer(file);
      fileReplacer.setDeleteBackupFile(true);

      fileReplacer.replace(new ContentWriter()
      {
        @Override
        public void write(final BufferedOutputStream output)
            throws IOException
        {
          new SecurityConfigurationXpp3Writer().write(output, configuration);
        }
      });
    }
    finally {

      // set back to clear text
      configuration.setAnonymousPassword(clearPassword);
    }
  }
View Full Code Here

Examples of org.sonatype.security.configuration.model.SecurityConfiguration

    else {
      this.getLogger().warn("Default static security configuration not found in classpath: "
          + STATIC_SECURITY_RESOURCE);
    }

    SecurityConfiguration configuration = getConfiguration();

    return configuration;
  }
View Full Code Here

Examples of org.sonatype.security.configuration.model.SecurityConfiguration

                                          ValidationRequest<SecurityConfiguration> request)
  {
    ValidationResponse validationResponse = new ValidationResponse();
    validationResponse.setContext(context);

    SecurityConfiguration configuration = request.getConfiguration();

    validationResponse.append(this.validateAnonymousUsername(context, configuration.getAnonymousUsername()));
    validationResponse.append(this.validateAnonymousPassword(context, configuration.getAnonymousPassword()));
    validationResponse.append(this.validateRealms(context, configuration.getRealms()));

    return validationResponse;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.