Package org.apache.geronimo.xbeans.javaee

Examples of org.apache.geronimo.xbeans.javaee.LoginConfigType


        LoginConfigType[] loginConfigArray = webApp.getLoginConfigArray();
        if (loginConfigArray.length > 1) {
            throw new DeploymentException("Web app " + module.getName() + " cannot have more than one login-config element.  Currently has " + loginConfigArray.length + " login-config elements.");
        }
        if (loginConfigArray.length == 1) {
            LoginConfigType loginConfig = loginConfigArray[0];
            if (loginConfig.isSetAuthMethod()) {
                String authMethod = loginConfig.getAuthMethod().getStringValue();
                if ("BASIC".equals(authMethod)) {
                    webModuleData.setAttribute("authenticator", new BasicAuthenticator());
                } else if ("DIGEST".equals(authMethod)) {
                    webModuleData.setAttribute("authenticator", new DigestAuthenticator());
                } else if ("FORM".equals(authMethod)) {

                    FormAuthenticator formAuthenticator = new FormAuthenticator();
                    webModuleData.setAttribute("authenticator", formAuthenticator);
                    if (loginConfig.isSetFormLoginConfig()) {
                        FormLoginConfigType formLoginConfig = loginConfig.getFormLoginConfig();
                        formAuthenticator.setLoginPage(formLoginConfig.getFormLoginPage().getStringValue());
                        formAuthenticator.setErrorPage(formLoginConfig.getFormErrorPage().getStringValue());
                    }
                } else if ("CLIENT-CERT".equals(authMethod)) {
                    webModuleData.setAttribute("authenticator", new ClientCertAuthenticator());
                }
            }
            if (loginConfig.isSetRealmName()) {
                webModuleData.setAttribute("realmName", loginConfig.getRealmName().getStringValue());
            }

        } else if (jettyWebApp.isSetSecurityRealmName()) {
            webModuleData.setAttribute("authenticator", new NonAuthenticator());
        }
View Full Code Here


        LoginConfigType[] loginConfigArray = webApp.getLoginConfigArray();
        if (loginConfigArray.length > 1) {
            throw new DeploymentException("Web app " + module.getName() + " cannot have more than one login-config element.  Currently has " + loginConfigArray.length + " login-config elements.");
        }
        if (loginConfigArray.length == 1) {
            LoginConfigType loginConfig = loginConfigArray[0];
            if (loginConfig.isSetAuthMethod()) {
                String authMethod = loginConfig.getAuthMethod().getStringValue();
                if ("BASIC".equals(authMethod)) {
                    webModuleData.setAttribute("authenticator", new BasicAuthenticator());
                } else if ("DIGEST".equals(authMethod)) {
                    webModuleData.setAttribute("authenticator", new DigestAuthenticator());
                } else if ("FORM".equals(authMethod)) {

                    FormAuthenticator formAuthenticator = new FormAuthenticator();
                    webModuleData.setAttribute("authenticator", formAuthenticator);
                    if (loginConfig.isSetFormLoginConfig()) {
                        FormLoginConfigType formLoginConfig = loginConfig.getFormLoginConfig();
                        formAuthenticator.setLoginPage(formLoginConfig.getFormLoginPage().getStringValue());
                        formAuthenticator.setErrorPage(formLoginConfig.getFormErrorPage().getStringValue());
                    }
                } else if ("CLIENT-CERT".equals(authMethod)) {
                    webModuleData.setAttribute("authenticator", new ClientCertAuthenticator());
                }
            }
            if (loginConfig.isSetRealmName()) {
                webModuleData.setAttribute("realmName", loginConfig.getRealmName().getStringValue());
            }

        } else if (jettyWebApp.isSetSecurityRealmName()) {
            webModuleData.setAttribute("authenticator", new NonAuthenticator());
        }
View Full Code Here

        LoginConfigType[] loginConfigArray = webApp.getLoginConfigArray();
        if (loginConfigArray.length > 1) {
            throw new DeploymentException("Web app " + module.getName() + " cannot have more than one login-config element.  Currently has " + loginConfigArray.length + " login-config elements.");
        }
        if (loginConfigArray.length == 1) {
            LoginConfigType loginConfig = loginConfigArray[0];
            if (loginConfig.isSetAuthMethod()) {
                String authMethod = loginConfig.getAuthMethod().getStringValue();
                if ("BASIC".equals(authMethod)) {
                    webModuleData.setAttribute("authenticator", new BasicAuthenticator());
                } else if ("DIGEST".equals(authMethod)) {
                    webModuleData.setAttribute("authenticator", new DigestAuthenticator());
                } else if ("FORM".equals(authMethod)) {

                    FormAuthenticator formAuthenticator = new FormAuthenticator();
                    webModuleData.setAttribute("authenticator", formAuthenticator);
                    if (loginConfig.isSetFormLoginConfig()) {
                        FormLoginConfigType formLoginConfig = loginConfig.getFormLoginConfig();
                        formAuthenticator.setLoginPage(formLoginConfig.getFormLoginPage().getStringValue());
                        formAuthenticator.setErrorPage(formLoginConfig.getFormErrorPage().getStringValue());
                    }
                } else if ("CLIENT-CERT".equals(authMethod)) {
                    webModuleData.setAttribute("authenticator", new ClientCertAuthenticator());
                }
            }
            if (loginConfig.isSetRealmName()) {
                webModuleData.setAttribute("realmName", loginConfig.getRealmName().getStringValue());
            }

        } else if (jettyWebApp.isSetSecurityRealmName()) {
            webModuleData.setAttribute("authenticator", new NonAuthenticator());
        }
View Full Code Here

        LoginConfigType[] loginConfigArray = webApp.getLoginConfigArray();
        if (loginConfigArray.length > 1) {
            throw new DeploymentException("Web app " + module.getName() + " cannot have more than one login-config element.  Currently has " + loginConfigArray.length + " login-config elements.");
        }
        if (loginConfigArray.length == 1) {
            LoginConfigType loginConfig = loginConfigArray[0];
            if (loginConfig.isSetAuthMethod()) {
                String authMethod = loginConfig.getAuthMethod().getStringValue();
                if ("BASIC".equals(authMethod)) {
                    webModuleData.setAttribute("authenticator", new BasicAuthenticator());
                } else if ("DIGEST".equals(authMethod)) {
                    webModuleData.setAttribute("authenticator", new DigestAuthenticator());
                } else if ("FORM".equals(authMethod)) {

                    FormAuthenticator formAuthenticator = new FormAuthenticator();
                    webModuleData.setAttribute("authenticator", formAuthenticator);
                    if (loginConfig.isSetFormLoginConfig()) {
                        FormLoginConfigType formLoginConfig = loginConfig.getFormLoginConfig();
                        formAuthenticator.setLoginPage(formLoginConfig.getFormLoginPage().getStringValue());
                        formAuthenticator.setErrorPage(formLoginConfig.getFormErrorPage().getStringValue());
                    }
                } else if ("CLIENT-CERT".equals(authMethod)) {
                    webModuleData.setAttribute("authenticator", new ClientCertAuthenticator());
                }
            }
            if (loginConfig.isSetRealmName()) {
                webModuleData.setAttribute("realmName", loginConfig.getRealmName().getStringValue());
            }

        } else if (jettyWebApp.isSetSecurityRealmName()) {
            webModuleData.setAttribute("authenticator", new NonAuthenticator());
        }
View Full Code Here

                configureConfigurationFactory(jettyWebApp, null, securityFactoryData);
                moduleContext.addGBean(securityFactoryData);
                configureLocalJaspicProvider(new JettyAuthenticationWrapper(authType), contextPath, module, securityFactoryData);
                //otherwise rely on pre-configured jaspi
            } else {
                LoginConfigType loginConfig = loginConfigArray.length == 1? loginConfigArray[0]: null;
                GBeanData securityFactoryData = new GBeanData(factoryName, JettySecurityHandlerFactory.class);
                configureConfigurationFactory(jettyWebApp, loginConfig, securityFactoryData);
                BuiltInAuthMethod auth = BuiltInAuthMethod.NONE;
                if (loginConfig != null) {
                    if (loginConfig.isSetAuthMethod()) {
                        String authMethod = loginConfig.getAuthMethod().getStringValue().trim();
                        auth = BuiltInAuthMethod.getValueOf(authMethod);

                        if (auth == BuiltInAuthMethod.BASIC) {
                            securityFactoryData.setAttribute("realmName", loginConfig.getRealmName().getStringValue().trim());
                        } else if (auth == BuiltInAuthMethod.DIGEST) {
                            securityFactoryData.setAttribute("realmName", loginConfig.getRealmName().getStringValue().trim());
                        } else if (auth == BuiltInAuthMethod.FORM) {
                            if (loginConfig.isSetFormLoginConfig()) {
                                FormLoginConfigType formLoginConfig = loginConfig.getFormLoginConfig();
                                securityFactoryData.setAttribute("loginPage", formLoginConfig.getFormLoginPage().getStringValue());
                                securityFactoryData.setAttribute("errorPage", formLoginConfig.getFormErrorPage().getStringValue());
                            }
                        } else if (auth == BuiltInAuthMethod.CLIENTCERT) {
                            //nothing to do
                        } else {
                            throw new DeploymentException("unrecognized auth method, use jaspi to configure: " + authMethod);
                        }

                    } else {
                        throw new DeploymentException("No auth method configured and no jaspi configured");
                    }
                    if (loginConfig.isSetRealmName()) {
                        webModuleData.setAttribute("realmName", loginConfig.getRealmName().getStringValue());
                    }
                }
                securityFactoryData.setAttribute("authMethod", auth);
                moduleContext.addGBean(securityFactoryData);
            }
View Full Code Here

        LoginConfigType[] loginConfigArray = webApp.getLoginConfigArray();
        if (loginConfigArray.length > 1) {
            throw new DeploymentException("Web app " + module.getName() + " cannot have more than one login-config element.  Currently has " + loginConfigArray.length + " login-config elements.");
        }
        if (loginConfigArray.length == 1) {
            LoginConfigType loginConfig = loginConfigArray[0];
            if (loginConfig.isSetAuthMethod()) {
                String authMethod = loginConfig.getAuthMethod().getStringValue();
                if ("BASIC".equals(authMethod)) {
                    webModuleData.setAttribute("authenticator", new BasicAuthenticator());
                } else if ("DIGEST".equals(authMethod)) {
                    webModuleData.setAttribute("authenticator", new DigestAuthenticator());
                } else if ("FORM".equals(authMethod)) {

                    FormAuthenticator formAuthenticator = new FormAuthenticator();
                    webModuleData.setAttribute("authenticator", formAuthenticator);
                    if (loginConfig.isSetFormLoginConfig()) {
                        FormLoginConfigType formLoginConfig = loginConfig.getFormLoginConfig();
                        formAuthenticator.setLoginPage(formLoginConfig.getFormLoginPage().getStringValue());
                        formAuthenticator.setErrorPage(formLoginConfig.getFormErrorPage().getStringValue());
                    }
                } else if ("CLIENT-CERT".equals(authMethod)) {
                    webModuleData.setAttribute("authenticator", new ClientCertAuthenticator());
                }
            }
            if (loginConfig.isSetRealmName()) {
                webModuleData.setAttribute("realmName", loginConfig.getRealmName().getStringValue());
            }

        } else if (jettyWebApp.isSetSecurityRealmName()) {
            webModuleData.setAttribute("authenticator", new NonAuthenticator());
        }
View Full Code Here

        LoginConfigType[] loginConfigArray = webApp.getLoginConfigArray();
        if (loginConfigArray.length > 1) {
            throw new DeploymentException("Web app " + module.getName() + " cannot have more than one login-config element.  Currently has " + loginConfigArray.length + " login-config elements.");
        }
        if (loginConfigArray.length == 1) {
            LoginConfigType loginConfig = loginConfigArray[0];
            if (loginConfig.isSetAuthMethod()) {
                String authMethod = loginConfig.getAuthMethod().getStringValue();
                if ("BASIC".equals(authMethod)) {
                    webModuleData.setAttribute("authenticator", new BasicAuthenticator());
                } else if ("DIGEST".equals(authMethod)) {
                    webModuleData.setAttribute("authenticator", new DigestAuthenticator());
                } else if ("FORM".equals(authMethod)) {

                    FormAuthenticator formAuthenticator = new FormAuthenticator();
                    webModuleData.setAttribute("authenticator", formAuthenticator);
                    if (loginConfig.isSetFormLoginConfig()) {
                        FormLoginConfigType formLoginConfig = loginConfig.getFormLoginConfig();
                        formAuthenticator.setLoginPage(formLoginConfig.getFormLoginPage().getStringValue());
                        formAuthenticator.setErrorPage(formLoginConfig.getFormErrorPage().getStringValue());
                    }
                } else if ("CLIENT-CERT".equals(authMethod)) {
                    webModuleData.setAttribute("authenticator", new ClientCertAuthenticator());
                }
            }
            if (loginConfig.isSetRealmName()) {
                webModuleData.setAttribute("realmName", loginConfig.getRealmName().getStringValue());
            }

        } else if (jettyWebApp.isSetSecurityRealmName()) {
            webModuleData.setAttribute("authenticator", new NonAuthenticator());
        }
View Full Code Here

        LoginConfigType[] loginConfigArray = webApp.getLoginConfigArray();
        if (loginConfigArray.length > 1) {
            throw new DeploymentException("Web app " + module.getName() + " cannot have more than one login-config element.  Currently has " + loginConfigArray.length + " login-config elements.");
        }
        if (loginConfigArray.length == 1) {
            LoginConfigType loginConfig = loginConfigArray[0];
            if (loginConfig.isSetAuthMethod()) {
                String authMethod = loginConfig.getAuthMethod().getStringValue();
                if ("BASIC".equals(authMethod)) {
                    webModuleData.setAttribute("authenticator", new BasicAuthenticator());
                } else if ("DIGEST".equals(authMethod)) {
                    webModuleData.setAttribute("authenticator", new DigestAuthenticator());
                } else if ("FORM".equals(authMethod)) {

                    FormAuthenticator formAuthenticator = new FormAuthenticator();
                    webModuleData.setAttribute("authenticator", formAuthenticator);
                    if (loginConfig.isSetFormLoginConfig()) {
                        FormLoginConfigType formLoginConfig = loginConfig.getFormLoginConfig();
                        formAuthenticator.setLoginPage(formLoginConfig.getFormLoginPage().getStringValue());
                        formAuthenticator.setErrorPage(formLoginConfig.getFormErrorPage().getStringValue());
                    }
                } else if ("CLIENT-CERT".equals(authMethod)) {
                    webModuleData.setAttribute("authenticator", new ClientCertAuthenticator());
                }
            }
            if (loginConfig.isSetRealmName()) {
                webModuleData.setAttribute("realmName", loginConfig.getRealmName().getStringValue());
            }

        } else if (jettyWebApp.isSetSecurityRealmName()) {
            webModuleData.setAttribute("authenticator", new NonAuthenticator());
        }
View Full Code Here

        LoginConfigType[] loginConfigArray = webApp.getLoginConfigArray();
        if (loginConfigArray.length > 1) {
            throw new DeploymentException("Web app " + module.getName() + " cannot have more than one login-config element.  Currently has " + loginConfigArray.length + " login-config elements.");
        }
        if (loginConfigArray.length == 1) {
            LoginConfigType loginConfig = loginConfigArray[0];
            if (loginConfig.isSetAuthMethod()) {
                String authMethod = loginConfig.getAuthMethod().getStringValue();
                if ("BASIC".equals(authMethod)) {
                    webModuleData.setAttribute("authenticator", new BasicAuthenticator());
                } else if ("DIGEST".equals(authMethod)) {
                    webModuleData.setAttribute("authenticator", new DigestAuthenticator());
                } else if ("FORM".equals(authMethod)) {

                    FormAuthenticator formAuthenticator = new FormAuthenticator();
                    webModuleData.setAttribute("authenticator", formAuthenticator);
                    if (loginConfig.isSetFormLoginConfig()) {
                        FormLoginConfigType formLoginConfig = loginConfig.getFormLoginConfig();
                        formAuthenticator.setLoginPage(formLoginConfig.getFormLoginPage().getStringValue());
                        formAuthenticator.setErrorPage(formLoginConfig.getFormErrorPage().getStringValue());
                    }
                } else if ("CLIENT-CERT".equals(authMethod)) {
                    webModuleData.setAttribute("authenticator", new ClientCertAuthenticator());
                }
            }
            if (loginConfig.isSetRealmName()) {
                webModuleData.setAttribute("realmName", loginConfig.getRealmName().getStringValue());
            }

        } else if (jettyWebApp.isSetSecurityRealmName()) {
            webModuleData.setAttribute("authenticator", new NonAuthenticator());
        }
View Full Code Here

        LoginConfigType[] loginConfigArray = webApp.getLoginConfigArray();
        if (loginConfigArray.length > 1) {
            throw new DeploymentException("Web app " + module.getName() + " cannot have more than one login-config element.  Currently has " + loginConfigArray.length + " login-config elements.");
        }
        if (loginConfigArray.length == 1) {
            LoginConfigType loginConfig = loginConfigArray[0];
            if (loginConfig.isSetAuthMethod()) {
                String authMethod = loginConfig.getAuthMethod().getStringValue();
                if ("BASIC".equals(authMethod)) {
                    webModuleData.setAttribute("authenticator", new BasicAuthenticator());
                } else if ("DIGEST".equals(authMethod)) {
                    webModuleData.setAttribute("authenticator", new DigestAuthenticator());
                } else if ("FORM".equals(authMethod)) {

                    FormAuthenticator formAuthenticator = new FormAuthenticator();
                    webModuleData.setAttribute("authenticator", formAuthenticator);
                    if (loginConfig.isSetFormLoginConfig()) {
                        FormLoginConfigType formLoginConfig = loginConfig.getFormLoginConfig();
                        formAuthenticator.setLoginPage(formLoginConfig.getFormLoginPage().getStringValue());
                        formAuthenticator.setErrorPage(formLoginConfig.getFormErrorPage().getStringValue());
                    }
                } else if ("CLIENT-CERT".equals(authMethod)) {
                    webModuleData.setAttribute("authenticator", new ClientCertAuthenticator());
                }
            }
            if (loginConfig.isSetRealmName()) {
                webModuleData.setAttribute("realmName", loginConfig.getRealmName().getStringValue());
            }

        } else if (jettyWebApp.isSetSecurityRealmName()) {
            webModuleData.setAttribute("authenticator", new NonAuthenticator());
        }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.xbeans.javaee.LoginConfigType

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.