Examples of AuthenticationManager


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

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

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

                              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

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

    /**
     * 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

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

        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

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

     */
    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

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

                                   ", 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

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

                                   ", 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

Examples of org.apache.isis.core.runtime.authentication.AuthenticationManager

    // Wicket Hooks
    // /////////////////////////////////////////////////

    @Override
    public Session newSession(final Request request, final Response response) {
        final AuthenticationManager authenticationManager = anonymousAuthenticationManager();

        final AnonymousWebSessionForIsis anonymousWebSession = new AnonymousWebSessionForIsis(request, authenticationManager);
        anonymousWebSession.authenticate(null, null);
        return anonymousWebSession;
    }
View Full Code Here

Examples of org.apache.isis.core.runtime.authentication.AuthenticationManager

public class AuthenticationSessionStrategyDefault extends AuthenticationSessionStrategyAbstract {

    @Override
    public AuthenticationSession lookupValid(final ServletRequest servletRequest, final ServletResponse servletResponse) {

        final AuthenticationManager authenticationManager = getAuthenticationManager();
        final HttpSession httpSession = getHttpSession(servletRequest);

        // use previously authenticated session if available
        AuthenticationSession authSession = (AuthenticationSession) httpSession.getAttribute(WebAppConstants.HTTP_SESSION_AUTHENTICATION_SESSION_KEY);
        if (authSession != null) {
            final boolean sessionValid = authenticationManager.isSessionValid(authSession);
            if (sessionValid) {
                return authSession;
            }
        }

        // otherwise, look for LogonFixture and try to authenticate
        final ServletContext servletContext = getServletContext(servletRequest);
        final IsisSystem system = (IsisSystem) servletContext.getAttribute(WebAppConstants.ISIS_SYSTEM_KEY);
        if (system == null) {
            // not expected to happen...
            return null;
        }
        final LogonFixture logonFixture = system.getLogonFixture();

        // see if exploration is supported
        if (system.getDeploymentType().isExploring()) {
            authSession = authenticationManager.authenticate(new AuthenticationRequestExploration(logonFixture));
            if (authSession != null) {
                return authSession;
            }
        }

        final boolean loggedInUsingLogonFixture = httpSession.getAttribute(WebAppConstants.HTTP_SESSION_LOGGED_ON_PREVIOUSLY_USING_LOGON_FIXTURE_KEY) != null;
        if (logonFixture != null && !loggedInUsingLogonFixture) {
            httpSession.setAttribute(WebAppConstants.HTTP_SESSION_LOGGED_ON_PREVIOUSLY_USING_LOGON_FIXTURE_KEY, true);
            return authenticationManager.authenticate(new AuthenticationRequestLogonFixture(logonFixture));
        }

        return null;
    }
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.