Package com.adito.security

Examples of com.adito.security.SessionInfo


                    throws Exception {
        MessageForm mf = (MessageForm)form;
        mf.setReferer(CoreUtil.getReferer(request));
        PropertyList selectedPolicies = new PropertyList();
        MultiSelectDataSource policies = new PolicyDataSource();
        SessionInfo session = LogonControllerFactory.getInstance().getSessionInfo(request);
     
        String users = request.getParameter("users");
       
        MultiSelectSelectionModel policyModel = initSelectModel(mf, selectedPolicies, mf.isShowPersonalPolicies(), users, session);
       
View Full Code Here


    public ActionForward toogleShowPersonalPolicies(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
                throws Exception {
        MessageForm mf = (MessageForm)form;
        PropertyList selectedPolicies = new PropertyList();
       
        SessionInfo session = this.getSessionInfo(request);
       
        String users = request.getParameter("users");

        MultiSelectSelectionModel policyModel = initSelectModel(mf, selectedPolicies, mf.isShowPersonalPolicies(), users, session);
       
View Full Code Here

     */
    public void reset(ActionMapping mapping, HttpServletRequest request) {
        super.reset(mapping, request);
        AbstractWizardSequence seq = getWizardSequence(request);
        selectedAccessRights = (PropertyList)seq.getAttribute(getAttributeKey(), new PropertyList())
        SessionInfo session = LogonControllerFactory.getInstance().getSessionInfo(request);
        String permissionClass = (String) seq.getAttribute(AccessRightsDetailsForm.ATTR_RESOURCE_PERMISSION_CLASS,
                        PolicyConstants.DELEGATION_CLASS);
        AccessRightsMultiSelectDataSource accessRightsMultiSelectDataSource = new AccessRightsMultiSelectDataSource(permissionClass);
        accessRightsModel = new MultiSelectSelectionModel(session, accessRightsMultiSelectDataSource, selectedAccessRights);
    }
View Full Code Here

    String path;
    String url = wf.getDestinationURL();
    String hostField = request.getHeader("Host");
    HostService hostService = hostField == null ? null : new HostService(hostField);
    SessionInfo session = getSessionInfo(request);

    try {
      launchSession.checkAccessRights(null, session);

      /*
 
View Full Code Here

                    throws Exception {
      PolicyUtil.checkPermission(PolicyConstants.ACCOUNTS_AND_GROUPS_RESOURCE_TYPE, PolicyConstants.PERM_DELETE, request);
      UserDatabase udb = UserDatabaseManager.getInstance().getUserDatabase(getSessionInfo(request).getUser().getRealm());
        String rolename = request.getParameter("rolename");
        Role role = udb.getRole(rolename);
        SessionInfo info = this.getSessionInfo(request);
        try {
            // Revoke all polices from the user
            PolicyDatabaseFactory.getInstance().revokeAllPoliciesFromPrincipal(role);
           
        udb.deleteRole(rolename);
View Full Code Here

        if (!udb.supportsPasswordChange()) {
            throw new Exception("Changing of passwords is not supported by the underlying user database.");
        }
        User user = LogonControllerFactory.getInstance().getUser(request);

        SessionInfo info = this.getSessionInfo(request);

        // Read in all of the confidential user attribute values
        Properties confidentialAttributes = new Properties();
        UserAttributes userAttributes = (UserAttributes) PropertyClassManager.getInstance().getPropertyClass(UserAttributes.NAME);
        for (PropertyDefinition def : userAttributes.getDefinitions()) {
            AttributeDefinition attrDef = (AttributeDefinition) def;
            if (attrDef.getVisibility() == AttributeDefinition.USER_CONFIDENTIAL_ATTRIBUTE) {
                confidentialAttributes.setProperty(def.getName(), attrDef.getPropertyClass()
                                .retrieveProperty(new UserAttributeKey(info.getUser(), def.getName())));
            }
        }

        try {

            // Change the password

            udb.changePassword(user.getPrincipalName(), f.getOldPassword(), f.getNewPassword(), false);
           
            PublicKeyStore publicKeyStore = PublicKeyStore.getInstance();
            if ("automatic".equals(Property.getProperty(new SystemConfigKey("security.privateKeyMode")))) { 
                if (publicKeyStore.isPassphraseValid(user.getPrincipalName(), f.getOldPassword())) {
                    publicKeyStore.changePrivateKeyPassphrase(user.getPrincipalName(), f.getOldPassword(), f.getNewPassword());
                    publicKeyStore.removeCachedKeys(user.getPrincipalName());
                    publicKeyStore.verifyPrivateKey(user.getPrincipalName(), f.getNewPassword().toCharArray());

                    // Write back all of the confidential user attribute values
                    for (PropertyDefinition def : userAttributes.getDefinitions()) {
                        AttributeDefinition attrDef = (AttributeDefinition) def;
                        if (attrDef.getVisibility() == AttributeDefinition.USER_CONFIDENTIAL_ATTRIBUTE) {
                            Property.setProperty(new UserAttributeKey(info.getUser(), def.getName()), confidentialAttributes
                                            .getProperty(def.getName()), info);
                        }
                    }
                } else {
                    // if the keystore is out of sync, the only option is to remove the key
View Full Code Here

        if (forward.getName().equals("home")){
            // super returned a home, so we must go home.
            return forward;
        }
        PropertyList selectedModules = new PropertyList();
        SessionInfo session = LogonControllerFactory.getInstance().getSessionInfo(request);
        MultiSelectDataSource modules = new ModulesDataSource("security");
        AuthenticationScheme seq = ((DefaultAuthenticationScheme) ((AbstractResourceForm) form).getResource());
        for (int i = 0; i < seq.getModuleCount(); i++) {
            String module = seq.getModule(i);
            selectedModules.add(module);
View Full Code Here

     *      javax.servlet.http.HttpServletResponse)
     */
    protected AbstractWizardSequence createWizardSequence(ActionMapping mapping, ActionForm form, HttpServletRequest request,
                    HttpServletResponse response) throws Exception {
        ActionForward fwd = mapping.findForward("finish");
        SessionInfo session = CoreServlet.getServlet().getLogonController().getSessionInfo(request);
        DefaultWizardSequence seq = new DefaultWizardSequence(fwd, "sample", "samplewizard", CoreUtil.getReferer(request),
                        "samplewizard", session);
        seq.putAttribute(ATTR_USER, CoreServlet.getServlet().getLogonController().getUser(request));
        seq.addStep(new WizardStep("/sampleDefaultDetails.do", true));
        seq.addStep(new WizardStep("/sampleDetails.do"));
View Full Code Here

     * @return forward
     * @throws Exception on any error
     */
    public ActionForward create(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
                    throws Exception {
        SessionInfo sessionInfo = getSessionInfo(request);
        UserDatabase userDatabase = UserDatabaseManager.getInstance().getUserDatabase(sessionInfo.getUser().getRealm());
        if (!userDatabase.supportsAccountCreation()) {
            throw new Exception("The underlying user database does not support role creation.");
        }
        PolicyUtil.checkPermission(PolicyConstants.ACCOUNTS_AND_GROUPS_RESOURCE_TYPE,
            PolicyConstants.PERM_CREATE_EDIT_AND_ASSIGN, request);
View Full Code Here

        if (role == null) {
            throw new Exception("No role configured for editing.");
        }
        PolicyUtil.checkPermission(PolicyConstants.ACCOUNTS_AND_GROUPS_RESOURCE_TYPE,
            PolicyConstants.PERM_CREATE_EDIT_AND_ASSIGN, request);
        SessionInfo sessionInfo = getSessionInfo(request);
        UserDatabase userDatabase = UserDatabaseManager.getInstance().getUserDatabase(sessionInfo.getUser().getRealm());
        List<User> users = Arrays.asList(userDatabase.getUsersInRole(role));

        RoleForm roleForm = (RoleForm) form;
        roleForm.initialize(users);
        roleForm.setRolename(role.getPrincipalName());
View Full Code Here

TOP

Related Classes of com.adito.security.SessionInfo

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.