Package com.adito.security

Examples of com.adito.security.User


               */
                logonStateMachine = new LogonStateAndCache(LogonStateAndCache.STATE_STARTED, request.getSession());
                request.getSession().removeAttribute(Constants.AUTH_SESSION);
                if(!Util.isNullOrTrimmedBlank(form.getUsername())) {
                  try {
                    User user = udb.getAccount(form.getUsername());
                    logonStateMachine.removeFromSpoofCache(user.getPrincipalName());
                    form.initUser();
                    try {
                      logonStateMachine.setUser(user);
                    }
                    catch(AccountLockedException ale) {
                      // Continue anyway and get the exception later
                    }
                    logonStateMachine.setState(LogonStateAndCache.STATE_DISPLAY_USERNAME_ENTERED);
                  }
                  catch(UserNotFoundException unfe) {
                      form.initUser();
                      // Spoof some authentication schemes
                      form.setHasMoreAuthenticationSchemes(true);
                  }
                }
               
            }
        } else {
            /*
             * A username has been provided but it was unknown. The error message
             * indicating this will not be displayed until the next stage is
             * complete
             */
          if (logonStateMachine.getState() == LogonStateAndCache.STATE_UNKNOWN_USERNAME) {
              logonStateMachine.setState(LogonStateAndCache.STATE_UNKNOWN_USERNAME_PROMPT_FOR_PASSWORD);
          }
          else  if (logonStateMachine.getState() == LogonStateAndCache.STATE_KNOWN_USERNAME_MULTIPLE_SCHEMES_SELECT){           
            /*
             * The scheme to sign on with has changed, so we need to update the
                 * logon state machine.
                 */
                logonStateMachine.forceHighestPriorityScheme(request.getParameter("selectedAuthenticationScheme"),
                    request.getParameter("username"));
                logonStateMachine.setState(LogonStateAndCache.STATE_KNOWN_USERNAME_MULTIPLE_SCHEMES);               
            } else if (logonStateMachine.getState() == LogonStateAndCache.STATE_KNOWN_USERNAME_NO_SCHEME_SPOOF_PASSWORD_ENTRY){
              /*
                 * The scheme to sign on with has changed, so we need to update the
                 * logon state machine
                 */
                logonStateMachine.setSpoofedHighestPriorityScheme(request.getParameter("username"));
            }
            else if(logonStateMachine.getState() == LogonStateAndCache.STATE_DISPLAY_USERNAME_ENTRY){
              /*
               * The username has been collected, now process it.
               */
              if(Util.isNullOrTrimmedBlank(form.getUsername())) {
                /**
                 * Page refreshed, stay in same state
                 */
                  logonStateMachine.setState(LogonStateAndCache.STATE_STARTED);
              }
              else {
                  logonStateMachine.setState(LogonStateAndCache.STATE_DISPLAY_USERNAME_ENTERED);
                  try {
                    User user = udb.getAccount(form.getUsername());
                    logonStateMachine.removeFromSpoofCache(user.getPrincipalName());
                    try {
                      logonStateMachine.setUser(user);
                    }
                    catch(AccountLockedException ale) {
                      // Continue anyway and get the exception later
View Full Code Here


     */
    public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request,
                                     HttpServletResponse response) throws Exception {
        PolicyUtil.checkPermissions(PolicyConstants.ACCESS_RIGHTS_RESOURCE_TYPE, new Permission[]{ PolicyConstants.PERM_EDIT_AND_ASSIGN, PolicyConstants.PERM_CREATE_EDIT_AND_ASSIGN, PolicyConstants.PERM_DELETE, PolicyConstants.PERM_ASSIGN}, request);
        AccessRightsListForm accessRightsListForm = (AccessRightsListForm) form;
        User user = LogonControllerFactory.getInstance().getUser(request);
        List resourcePermissions = PolicyDatabaseFactory.getInstance().getAccessRights(user.getRealm().getRealmID());
        accessRightsListForm.initialize(resourcePermissions, request.getSession());
        return super.unspecified(mapping, form, request, response);
    }
View Full Code Here

        if (authScheme == null) {
            throw new DAVAuthenticationRequiredException("No valid authentication scheme.");
        }
        // Find user
        try {
            User user = UserDatabaseManager.getInstance().getDefaultUserDatabase().getAccount(username);
            authScheme.setUser(user);
            LogonAction.authenticate(authScheme, req);
            LogonAction.finishAuthentication(authScheme, req, res);
        } catch (InvalidLoginCredentialsException ilce) {
            // Incorrect details, try again
View Full Code Here

    public CheckPropertyNotEqualsTag() {
    }

    public int doStartTag() {

        User user = null;
        try {
            user = LogonControllerFactory.getInstance().getUser(pageContext.getSession(), null);
        } catch (SecurityErrorException ex) {
        }
        String val;
View Full Code Here

        super.release();
        value = null;
    }

    public int doStartTag() {
        User user = null;
        try {
            user = LogonControllerFactory.getInstance().getUser(pageContext.getSession(), null);
        } catch (SecurityErrorException ex) {
        }
        try {
View Full Code Here

        value = null;
        userProfile = false;
    }

    public int doStartTag() {
        User user = null;
        try {
            user = LogonControllerFactory.getInstance().getUser(pageContext.getSession(), null);
        } catch (SecurityErrorException ex) {
        }
        if(userProfile) {
View Full Code Here

    public CheckPropertyEqualsTag() {
    }

    public int doStartTag() {

        User user = null;
        try {
            user = LogonControllerFactory.getInstance().getUser(pageContext.getSession(), null);
        } catch (SecurityErrorException ex) {
        }
        String val;
View Full Code Here

     * @param session session
     * @return the available profiles
     * @throws Exception
     */
    public static List setAvailableProfiles(SessionInfo session) throws Exception {
        User user = LogonControllerFactory.getInstance().getUser(session.getHttpSession(), null);
        List profiles = filterResources(user, ProfilesFactory.getInstance().getPropertyProfiles(
                        user.getPrincipalName(), true, session.getUser().getRealm().getResourceId()), false);
        session.getHttpSession().setAttribute(Constants.PROFILES, profiles);
        return profiles;
    }
View Full Code Here

    /* (non-Javadoc)
     * @see com.adito.policyframework.forms.AbstractWizardPolicySelectionForm#createDatasource(org.apache.struts.action.ActionMapping, javax.servlet.http.HttpServletRequest)
     */
    public MultiSelectDataSource createDatasource(ActionMapping mapping, HttpServletRequest request) {
        try {
            User u = LogonControllerFactory.getInstance().getUser(request);
            return new DelegatedPoliciesDataSource(null, resourceType, (String)getWizardSequence(request).getAttribute(AccessRightsDetailsForm.ATTR_RESOURCE_PERMISSION_CLASS, null),
                u);
        }
        catch(Exception e) {
            return null;
View Full Code Here

     * (non-Javadoc)
     * @see com.adito.table.TableItemAction#isEnabled(com.adito.table.AvailableTableItemAction)
     */
    public boolean isEnabled(AvailableTableItemAction availableItem) {
        try {
            User user = availableItem.getSessionInfo().getUser();
            UserItem item = (UserItem) availableItem.getRowItem();
            return isPermitted(user) && isEnabled(item);
        } catch (Exception e) {
            return false;
        }
View Full Code Here

TOP

Related Classes of com.adito.security.User

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.