Package org.apache.cocoon.webapps.authentication.user

Examples of org.apache.cocoon.webapps.authentication.user.UserHandler


        try {
            authManager = (AuthenticationManager)this.manager.lookup(AuthenticationManager.ROLE);
            final UserInfo info = new UserInfo(portalName, layoutKey);

            final RequestState state = authManager.getState();
            final UserHandler handler = state.getHandler();

            info.setUserName(handler.getUserId());
            try {
                info.setGroup((String)handler.getContext().getContextInfo().get("group"));
            } catch (ProcessingException pe) {
                // ignore this
            }

            final ApplicationConfiguration ac = state.getApplicationConfiguration();       
View Full Code Here


                                CopletFactory copletFactory,
                                LayoutFactory layoutFactory,
                                ServiceSelector adapterSelector)
    throws Exception {
        final RequestState state = this.getRequestState();
        final UserHandler handler = state.getHandler();
        final ApplicationConfiguration ac = state.getApplicationConfiguration();       
        if ( ac == null ) {
            throw new ProcessingException("Configuration for portal not found in application configuration.");
        }
        final Configuration appConf = ac.getConfiguration("portal");
View Full Code Here

            if (layoutKey == null) {
                layoutKey = service.getDefaultLayoutKey();
            }

            final RequestState state = this.getRequestState();
            final UserHandler handler = state.getHandler();

            final HashMap parameters = new HashMap();
            parameters.put("type", "user");
            parameters.put("config", state.getApplicationConfiguration().getConfiguration("portal").getChild("profiles"));
            parameters.put("handler", handler);
View Full Code Here

            if ( layoutKey == null ) {
                layoutKey = service.getDefaultLayoutKey();
            }

            final RequestState state = this.getRequestState();
            final UserHandler handler = state.getHandler();

            final HashMap parameters = new HashMap();
            parameters.put("type", "user");
            parameters.put("config", state.getApplicationConfiguration().getConfiguration("portal").getChild("profiles"));
            parameters.put("handler", handler);
View Full Code Here

        // TODO Change to KeyManager usage
        final String type = (String)parameters.get("type");
        final Configuration config = (Configuration) parameters.get("config");
        final String profileType = (String)parameters.get("profiletype");
        final String postFix = (load ? "load" : "save");
        final UserHandler handler = (UserHandler)parameters.get("handler");
       
        String uri = null;
        if (type == null) {
            uri = config.getChild(profileType + "-" + postFix).getAttribute("uri");
        } else if (type.equals("global")) {
            uri = config.getChild(profileType + "-global-" + postFix).getAttribute("uri");
        } else if (type.equals("role")) {
            uri = config.getChild(profileType + "-role-" + postFix).getAttribute("uri");
        } else if (type.equals("user")) {
            uri = config.getChild(profileType + "-user-" + postFix).getAttribute("uri");
        }

        Map key = new LinkedMap();
        key.put("baseuri", uri);
        key.put("separator", "?");
        key.put("portal", service.getPortalName());
        key.put("layout", layoutKey);
        if ( type != null ) {
            key.put("type", type);
            if ( "role".equals(type) || "user".equals(type)) {
                key.put("role", handler.getContext().getContextInfo().get("role"));
            }
            if ( "user".equals(type) ) {
                key.put("user", handler.getUserId());
            }
        }
        return key;
    }
View Full Code Here

    throws Exception {
        AuthenticationManager authManager = null;
        try {
            authManager = (AuthenticationManager)this.manager.lookup(AuthenticationManager.ROLE);
            final RequestState state = authManager.getState();
            final UserHandler handler = state.getHandler();

            final UserInfo info = new AFWUserInfo(portalName, layoutKey, handler);


            info.setUserName(handler.getUserId());
            try {
                info.setGroup((String)handler.getContext().getContextInfo().get("group"));
            } catch (ProcessingException pe) {
                // ignore this
            }

            final ApplicationConfiguration ac = state.getApplicationConfiguration();       
View Full Code Here

            } finally {
                this.manager.release( authManager );
            }
           
            if ( null != state ) {
                UserHandler handler = state.getHandler();
                if ( handler != null ) {
                    context = handler.getContext();
                }
            }
        }
        return context;
    }
View Full Code Here

        }

        this.xmlConsumer.startDocument();
        if ( state != null ) {
            try {
                UserHandler userhandler = state.getHandler();

                Configuration conf = state.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,
                                                                          state.getApplicationName());
                this.showConfiguration(this.xmlConsumer, this.source, handler, userhandler.getContext());

            } catch (ConfigurationException ex) {
                throw new ProcessingException("ConfigurationException: " + ex, ex);
            }
        }
View Full Code Here

        // authenticate
        AuthenticationManager authManager = null;
        try {
            authManager = (AuthenticationManager) this.manager.lookup(AuthenticationManager.ROLE);
            UserHandler handler = authManager.login(handlerName,
                                                    par.getParameter("application", null),
                                                    authenticationParameters);
            if (handler != null) {
                // success
                map = handler.getContext().getContextInfo();
            }
        } finally {
            this.manager.release(authManager);
        }
View Full Code Here

        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

TOP

Related Classes of org.apache.cocoon.webapps.authentication.user.UserHandler

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.