Package org.apache.cocoon.webapps.authentication.components

Examples of org.apache.cocoon.webapps.authentication.components.AuthenticationManager


        } else {
           throw new ProcessingException("Unknown mode " + modeString);
        }

        // logout
        AuthenticationManager authManager = null;
        try {
            authManager = (AuthenticationManager) this.manager.lookup(AuthenticationManager.ROLE);
            final String handlerName = par.getParameter("handler",
                                                         authManager.getHandlerName());
            if ( null == handlerName )
                throw new ProcessingException("LogoutAction requires at least the handler parameter.");
            authManager.logout( handlerName , mode );
        } finally {
            this.manager.release( authManager );
        }

        if (this.getLogger().isDebugEnabled() == true) {
View Full Code Here


                              String          handlerName,
                              String          applicationName,
                              SourceResolver  resolver,
                              ComponentManager manager)
    throws ProcessingException {
        AuthenticationManager authManager = null;
        try {
            authManager = (AuthenticationManager)manager.lookup(AuthenticationManager.ROLE);
            Handler handler = authManager.getHandler();
            this.name = contextName;
            this.authContext = context;
            this.handlerName = handlerName;
            this.applicationName = applicationName;
            this.authLoadResource = handler.getLoadResource();
View Full Code Here

    /**
     * Selector
     */
    public boolean select (String expression, Map objectModel, Parameters parameters) {
        AuthenticationManager authManager = null;
        boolean result;
        try {
            authManager = (AuthenticationManager) this.manager.lookup( AuthenticationManager.ROLE );
            result = authManager.testMedia(objectModel, expression);
        } catch (Exception local) {
            // ignore me
            result = false;
        } finally {
            this.manager.release( authManager );
View Full Code Here

        if (name.equals(org.apache.cocoon.webapps.authentication.AuthenticationConstants.SESSION_CONTEXT_NAME) == true) {
            final Request req = ObjectModelHelper.getRequest(objectModel);
            final Session session = req.getSession(false);
           
            if ( null != session ) {
                AuthenticationManager authManager = null;
                try {
                    authManager = (AuthenticationManager)manager.lookup(AuthenticationManager.ROLE);
                    final String handlerName = authManager.getHandlerName();
                    final String appName     = authManager.getApplicationName();
                    if ( null != handlerName ) {
                        context = new SessionContextImpl((SessionContext)session.getAttribute(AuthenticationConstants.SESSION_ATTRIBUTE_CONTEXT_NAME),
                                                         name, handlerName, appName, resolver, manager);
                    }
                } catch (ComponentException ce) {
View Full Code Here

     */
    public void generate()
    throws IOException, SAXException, ProcessingException {

        this.xmlConsumer.startDocument();
        AuthenticationManager authManager = null;
        try {
            authManager = (AuthenticationManager)this.manager.lookup(AuthenticationManager.ROLE);

            if (authManager.isAuthenticated() == true) {
                Configuration conf = authManager.getModuleConfiguration("single-role-user-management");
                if (conf == null) {
                    throw new ProcessingException("Module configuration 'single-role-user-management' for authentication user management generator not found.");
                }
                UserManagementHandler handler = new UserManagementHandler(conf,
                                                                          authManager.getApplicationName());
                this.showConfiguration(this.xmlConsumer, this.source, handler, authManager);
            }
        } catch (ConfigurationException ex) {
            throw new ProcessingException("ConfigurationException: " + ex, ex);
        } catch (ComponentException ex) {
View Full Code Here

                                   ", source="+source+
                                   ", par="+par);
        }
        String handlerName = null;
        String applicationName = null;
        AuthenticationManager authManager = null;
        Map map = null;

        try {
            handlerName = par.getParameter("handler", null);
            applicationName = par.getParameter("application", null);

            authManager = (AuthenticationManager) this.manager.lookup( AuthenticationManager.ROLE );

            // do authentication
            if ( !authManager.checkAuthentication(redirector, handlerName, applicationName) ) {
                // All events are ignored
                // the sitemap.xsl ensures that only the redirect is processed
            } else {
                map = authManager.createMap();
            }
        } finally {
            this.manager.release( authManager );
        }
        if (this.getLogger().isDebugEnabled() == true) {
View Full Code Here

                                   ", par="+par);
        }

        Map map = null;
        String handlerName = par.getParameter("handler", null);
        AuthenticationManager authManager = null;

        try {
            authManager = (AuthenticationManager) this.manager.lookup(AuthenticationManager.ROLE);
            if (authManager.isAuthenticated(handlerName) == true) {
                map = authManager.createMap();
            }
        } finally {
            this.manager.release(authManager);
        }
View Full Code Here

TOP

Related Classes of org.apache.cocoon.webapps.authentication.components.AuthenticationManager

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.