Package com.adito.security

Examples of com.adito.security.AuthenticationScheme


    public static List getSignonAuthenticationSchemeIDs(User user) throws Exception {
        List<Integer> resourceIds = PolicyDatabaseFactory.getInstance().getGrantedResourcesOfType(user,
                        PolicyConstants.AUTHENTICATION_SCHEMES_RESOURCE_TYPE);
        List<Integer> filteredResourceIDs = new ArrayList<Integer>();
        for (Integer integer : resourceIds) {
            AuthenticationScheme authenticationScheme = SystemDatabaseFactory.getInstance().getAuthenticationSchemeSequence(integer);
            // Need to check for null because a plugin may have been removed that provided a previously valid scheme
            if (authenticationScheme != null && !authenticationScheme.isSystemScheme())
                filteredResourceIDs.add(authenticationScheme.getResourceId());
        }
        return filteredResourceIDs;
    }
View Full Code Here


    ResourceItem item = getResourceItem(availableItem);
    HttpServletRequest request = availableItem.getRequest();
    SessionInfo sessionInfo = LogonControllerFactory.getInstance().getSessionInfo(request);
    try {
        // this is an extra check to ensure that the webDav authentication scheme is accessible to allow web folders.
        AuthenticationScheme authenticationSchemeSequence = SystemDatabaseFactory.getInstance().getAuthenticationSchemeSequence("WebDAV", sessionInfo.getRealm().getRealmID());
        boolean principalAllowed = PolicyDatabaseFactory.getInstance().isPrincipalAllowed(sessionInfo.getUser(), authenticationSchemeSequence, true);
        if (principalAllowed){
              BrowserChecker checker = new BrowserChecker(request.getHeader("user-agent"));
              if (item.getResource().getResourceType().equals(
                      NetworkPlacePlugin.NETWORK_PLACE_RESOURCE_TYPE)
View Full Code Here

     *
     * @see com.adito.policyframework.Resource#requiresPassword()
     */
    public boolean sessionPasswordRequired(SessionInfo sessionInfo) {
        boolean hasSessionPassword = false;
        AuthenticationScheme scheme = sessionInfo.getHttpSession() == null ? null : (AuthenticationScheme) sessionInfo
                        .getHttpSession().getAttribute(Constants.AUTH_SESSION);
        if (scheme != null) {
            char[] pw = LogonControllerFactory.getInstance().getPasswordFromCredentials(scheme);
            if (pw != null) {
                hasSessionPassword = true;
View Full Code Here

                // does the user have any other signonable authentication
                // schemes?
                boolean found = false;
                SessionInfo info = LogonControllerFactory.getInstance().getSessionInfo(request);
                for (Iterator iter = granted.iterator(); iter.hasNext();) {
                    AuthenticationScheme element = (DefaultAuthenticationScheme) iter.next();
                    if (element.getEnabled() && !element.isSystemScheme() && element.getResourceId() != this.getResourceId()) {

                        for (Iterator iterator = PolicyDatabaseFactory.getInstance().getPoliciesAttachedToResource(element,
                            info.getUser().getRealm()).iterator(); iterator.hasNext();) {
                            Policy policy = (Policy) iterator.next();
                            if (PolicyDatabaseFactory.getInstance().isPolicyGrantedToUser(policy,
View Full Code Here

     * (non-Javadoc)
     *
     * @see com.adito.policyframework.forms.AbstractResourceForm#applyToResource()
     */
    public void applyToResource() throws Exception {
        AuthenticationScheme seq = (DefaultAuthenticationScheme) getResource();
        seq.clearModules();
        for (Iterator i = getSelectedModulesList().iterator(); i.hasNext();) {
            seq.addModule((String) i.next());
        }
    }
View Full Code Here

        try {
            ResultSet rs = ps.executeQuery();
            try {
                List<AuthenticationScheme> sequences = new ArrayList<AuthenticationScheme>();
                while (rs.next()) {
                    AuthenticationScheme sequence = buildAuthenticationSchemeSequence(rs);
                    if (sequence != null) {
                        sequences.add(sequence);
                    }
                }
                return sequences;
View Full Code Here

            ps.setInt(5, enabled ? 1 : 0);
            ps.setInt(6, priority);
            ps.setInt(7, realmID);
            ps.execute();
            int id = db.getLastInsertId(ps, "createAuthenticationSchemeSequence.lastInsertId");
            AuthenticationScheme sequence = getAuthenticationSchemeSequence(id);
            updateAuthenticationSequence(sequence, modules);
            return sequence;
        } finally {
            ps.releasePreparedStatement();
        }
View Full Code Here

        int indexOf = schemes.indexOf(scheme);
        if (indexOf == 0)
            throw new IllegalStateException("Scheme is already set to highest priority");

        int schemeAboveIndex = indexOf - 1;
        AuthenticationScheme schemeAbove = schemes.get(schemeAboveIndex);
        updateAuthenticationSchemePriority(scheme, schemeAbove.getPriorityInt());
        updateAuthenticationSchemePriority(schemeAbove, scheme.getPriorityInt());
    }
View Full Code Here

        int indexOf = schemes.indexOf(scheme);
        if (indexOf == schemes.size() - 1)
            throw new IllegalStateException("Scheme is already set to lowest priority");

        int schemeBelowIndex = indexOf + 1;
        AuthenticationScheme schemeBelow = schemes.get(schemeBelowIndex);
        updateAuthenticationSchemePriority(scheme, schemeBelow.getPriorityInt());
        updateAuthenticationSchemePriority(schemeBelow, scheme.getPriorityInt());
    }
View Full Code Here

    /*
     * (non-Javadoc)
     * @see com.adito.security.SystemDatabase#deleteAuthenticationSchemeSequence(java.lang.String)
     */
    public void deleteAuthenticationSchemeSequence(int id) throws Exception {
        AuthenticationScheme scheme = getAuthenticationSchemeSequence(id);
        if (scheme == null) {
            throw new Exception("No authentication scheme with " + id + ".");
        }
        deleteAuthenticationScheme(id);
        deleteAuthenticationSequence(id);
View Full Code Here

TOP

Related Classes of com.adito.security.AuthenticationScheme

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.