Package org.jboss.as.security.Constants

Examples of org.jboss.as.security.Constants.URL


        try {
            super.setup(managementClient, containerId);
            log.debug("start of the domain creation");

            ClassLoader tccl = Thread.currentThread().getContextClassLoader();
            URL keystore = tccl.getResource("security/jsse.keystore");
            URL roles = getClass().getResource("cert/roles.properties");

            final List<ModelNode> updates = new ArrayList<ModelNode>();
            PathAddress address = PathAddress.pathAddress().append(SUBSYSTEM, "security")
                    .append(SECURITY_DOMAIN, APP_SECURITY_DOMAIN);

            updates.add(Util.createAddOperation(address));
            address = address.append(Constants.AUTHENTICATION, Constants.CLASSIC);
            updates.add(Util.createAddOperation(address));

            ModelNode loginModule = Util.createAddOperation(address.append(LOGIN_MODULE, "CertificateRoles"));
            loginModule.get(CODE).set("CertificateRoles");
            loginModule.get(FLAG).set("required");
            ModelNode moduleOptions = loginModule.get(MODULE_OPTIONS);
            moduleOptions.add("securityDomain", APP_SECURITY_DOMAIN);
            moduleOptions.add("rolesProperties", roles.getPath());
            loginModule.get(OPERATION_HEADERS).get(ALLOW_RESOURCE_SERVICE_RESTART).set(true);

            updates.add(loginModule);

            // Add the JSSE security domain.
View Full Code Here


        }
    }

    @Override
    protected SecurityRealm[] getSecurityRealms() throws Exception {
        URL keystoreResource = Thread.currentThread().getContextClassLoader().getResource("security/server.keystore");
        URL truststoreResource = Thread.currentThread().getContextClassLoader().getResource("security/jsse.keystore");

        RealmKeystore keystore = new RealmKeystore.Builder()
                .keystorePassword("changeit")
                .keystorePath(keystoreResource.getPath())
                .build();

        RealmKeystore truststore = new RealmKeystore.Builder()
                .keystorePassword("changeit")
                .keystorePath(truststoreResource.getPath())
                .build();
        return new SecurityRealm[]{new SecurityRealm.Builder()
                .name("ssl-cert-realm")
                .serverIdentity(
                        new ServerIdentity.Builder()
View Full Code Here

TOP

Related Classes of org.jboss.as.security.Constants.URL

Copyright © 2018 www.massapicom. 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.