Package org.jasig.cas.authentication.principal

Examples of org.jasig.cas.authentication.principal.SimplePrincipal


    public void testResponseWithoutAuthMethod() throws Exception {
        final Map<String, Object> model = new HashMap<String, Object>();
       
        final Map<String, Object> attributes = new HashMap<String, Object>();
        attributes.put("testAttribute", "testValue");
        final SimplePrincipal principal = new SimplePrincipal("testPrincipal", attributes);
       
        final MutableAuthentication authentication = new MutableAuthentication(principal);
        final List<Authentication> authentications = new ArrayList<Authentication>();
        authentications.add(authentication);
       
View Full Code Here


        this.response.setIssuer(null);
       
        final Map<String, Object> model = new HashMap<String, Object>();
       
        final Map<String, Object> attributes = new HashMap<String, Object>();
        final SimplePrincipal principal = new SimplePrincipal("testPrincipal", attributes);
       
        final MutableAuthentication authentication = new MutableAuthentication(principal);
        final List<Authentication> authentications = new ArrayList<Authentication>();
        authentications.add(authentication);
       
View Full Code Here

    private Map<String, Object> model;

    protected void setUp() throws Exception {
        this.model = new HashMap<String,Object>();
        List<Authentication> list = new ArrayList<Authentication>();
        list.add(new ImmutableAuthentication(new SimplePrincipal("test")));
        this.model.put("assertion", new ImmutableAssertionImpl(list,
            TestUtils.getService("TestService"), true));
    }
View Full Code Here

    }

    protected SimplePrincipal getSimplePrincipal(final String name,
        final boolean isNtlm) {
        if (this.principalWithDomainName) {
            return new SimplePrincipal(name);
        }
        if (isNtlm) {
          return Pattern.matches("\\S+\\\\\\S+", name) ? new SimplePrincipal
              (name.split("\\\\")[1]) : new SimplePrincipal(name);
        }
        return new SimplePrincipal(name.split("@")[0]);
    }
View Full Code Here

                        lmResponse, ntResponse);
                    log.debug("Trying to authenticate " + type3.getUser()
                        + " with domain controller");
                    try {
                        SmbSession.logon(dc, ntlm);
                        ntlmCredentials.setPrincipal(new SimplePrincipal(type3
                            .getUser()));
                        return true;
                    } catch (final SmbAuthException sae) {
                        log.debug("Authentication failed", sae);
                        return false;
View Full Code Here

        try {
            final String username = credential.getUsername();
            final String password = getPasswordEncoder().encode(credential.getPassword());
            final Connection c = this.getDataSource().getConnection(username, password);
            DataSourceUtils.releaseConnection(c, this.getDataSource());
            return createHandlerResult(credential, new SimplePrincipal(username), null);
        } catch (final SQLException e) {
            throw new FailedLoginException(e.getMessage());
        } catch (final Exception e) {
            throw new PreventedException("Unexpected SQL connection error", e);
        }
View Full Code Here

                throw new FailedLoginException("Multiple records found for " + username);
            }
        } catch (final DataAccessException e) {
            throw new PreventedException("SQL exception while executing query for " + username, e);
        }
        return createHandlerResult(credential, new SimplePrincipal(username), null);
    }
View Full Code Here

            throw new PreventedException("SQL exception while executing query for " + username, e);
        }
        if (count == 0) {
            throw new FailedLoginException(username + " not found with SQL query.");
        }
        return createHandlerResult(credential, new SimplePrincipal(username), null);
    }
View Full Code Here

TOP

Related Classes of org.jasig.cas.authentication.principal.SimplePrincipal

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.