Package org.apache.cocoon.webapps.authentication

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


        }
        super.recycle();
    }

    public RequestState getRequestState() {
        AuthenticationManager authManager = null;
        try {
            authManager = (AuthenticationManager)this.manager.lookup(AuthenticationManager.ROLE);
            return authManager.getState();   
        } catch (ComponentException ce) {
            // ignore this here
            return null;
        } finally {
            this.manager.release( (Component)authManager );
View Full Code Here


    /**
     * Get the current authentication state
     */
    protected RequestState getRequestState() {
        AuthenticationManager authManager = null;
        try {
            authManager = (AuthenticationManager)this.manager.lookup(AuthenticationManager.ROLE);
            return authManager.getState();   
        } catch (ComponentException ce) {
            // ignore this here
            return null;
        } finally {
            this.manager.release( (Component)authManager );
View Full Code Here

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

        AuthenticationManager authManager = null;
        RequestState state = null;
        try {
            authManager = (AuthenticationManager)this.manager.lookup(AuthenticationManager.ROLE);
            state = authManager.getState();
           
        } catch (Exception ignore) {
        }
       
        this.xmlConsumer.startDocument();
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 {
                RequestState state = authManager.getState();
                map = state.getHandler().getContext().getContextInfo();
            }
        } finally {
            this.manager.release( authManager );
        }
View Full Code Here

                                   ", par="+par);
        }

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

        final boolean testNotLoggedIn = par.getParameterAsBoolean("negate-result", false);
       
        try {
            authManager = (AuthenticationManager) this.manager.lookup(AuthenticationManager.ROLE);
            UserHandler handler = authManager.isAuthenticated(handlerName);
            if ( testNotLoggedIn ) {
                if ( handler == null ) {
                    map = EMPTY_MAP;
                }
            } else {
View Full Code Here

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

        // logout
        AuthenticationManager authManager = null;
        try {
            authManager = (AuthenticationManager) this.manager.lookup(AuthenticationManager.ROLE);
            RequestState state = authManager.getState();
           
            final String handlerName = par.getParameter("handler",
                                                         (state == null ? null : state.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() ) {
View Full Code Here

    /**
     * Load the basket
     */
    protected Basket loadBasket() {
        Basket basket = null;
        AuthenticationManager authManager = null;
        try {
            authManager = (AuthenticationManager)this.manager.lookup(AuthenticationManager.ROLE);
            RequestState rs = authManager.getState();
            final String user = (String)rs.getHandler().getContext().getContextInfo().get("ID");
            basket = this.loadBasket(user);
        } catch (ProcessingException ignore) {
            // ignore this
        } catch (ServiceException ignore) {
View Full Code Here

    /**
     * Save the basket
     */
    protected void saveBasket(Basket basket) {
        if ( basket != null ) {
            AuthenticationManager authManager = null;
            try {
                authManager = (AuthenticationManager)this.manager.lookup(AuthenticationManager.ROLE);
                RequestState rs = authManager.getState();
                final String user = (String)rs.getHandler().getContext().getContextInfo().get("ID");
                this.saveBasket(basket, user);
            } catch (ProcessingException ignore) {
                // ignore this
            } catch (ServiceException ignore) {
View Full Code Here

    /**
     * Get the current authentication state of the user
     * @return the current authentication state of the user
     */
    protected RequestState getRequestState() {
        AuthenticationManager authManager = null;
        try {
            authManager = (AuthenticationManager)this.manager.lookup(AuthenticationManager.ROLE);
            return authManager.getState();   
        } catch (ServiceException ce) {
            // ignore this here
            return null;
        } finally {
            this.manager.release( authManager );
View Full Code Here

    public SessionContext getSessionContext(String name)
    throws ProcessingException {
        AuthenticationContext context = null;
        if (name.equals(AuthenticationConstants.SESSION_CONTEXT_NAME) ) {
           
            AuthenticationManager authManager = null;
            RequestState state = null;
            try {
                authManager = (AuthenticationManager)this.manager.lookup(AuthenticationManager.ROLE);
                state = authManager.getState();
            } catch (ServiceException ignore) {
            } finally {
                this.manager.release( authManager );
            }
           
View Full Code Here

TOP

Related Classes of org.apache.cocoon.webapps.authentication.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.