Package org.jasig.cas.authentication

Examples of org.jasig.cas.authentication.MutableAuthentication


    }
   
    public void testSuccessfulServiceTicket() throws Exception {
        final MockRequestContext context = new MockRequestContext();
        final MockHttpServletRequest request = new MockHttpServletRequest();
        final Authentication authentication = new MutableAuthentication(new SimplePrincipal("scootman28"));
        final TicketGrantingTicket t = new TicketGrantingTicketImpl("TGT-11", authentication, new NeverExpiresExpirationPolicy());
       
        this.ticketRegistry.addTicket(t);
       
        request.setParameter("openid.identity", "http://openid.aol.com/scootman28");
View Full Code Here


       
        assertFalse(this.openIdCredentialsAuthenticationHandler.authenticate(c));
    }
   
    protected TicketGrantingTicket getTicketGrantingTicket() {
        final Authentication authentication = new MutableAuthentication(new SimplePrincipal("test"));
        return new TicketGrantingTicketImpl("test", authentication, new NeverExpiresExpirationPolicy());
    }
View Full Code Here

                    }
                }

                final Principal modifiedPrincipal = new SimplePrincipal(
                    principalId, attributes);
                final MutableAuthentication mutableAuthentication = new MutableAuthentication(
                    modifiedPrincipal, authentication.getAuthenticatedDate());
                mutableAuthentication.getAttributes().putAll(
                    authentication.getAttributes());
                mutableAuthentication.getAuthenticatedDate().setTime(
                    authentication.getAuthenticatedDate().getTime());
                authToUse = mutableAuthentication;
            } else {
                authToUse = authentication;
            }
View Full Code Here

public class RememberMeAuthenticationMetaDataPopulatorTests extends TestCase {
   
    private RememberMeAuthenticationMetaDataPopulator p  = new RememberMeAuthenticationMetaDataPopulator();

    public void testWithTrueRememberMeCredentials() {
        final Authentication auth = new MutableAuthentication(TestUtils.getPrincipal());
        final RememberMeUsernamePasswordCredentials c = new RememberMeUsernamePasswordCredentials();
        c.setRememberMe(true);
       
        final Authentication auth2 = this.p.populateAttributes(auth, c);
       
View Full Code Here

       
        assertEquals(Boolean.TRUE, auth2.getAttributes().get(RememberMeCredentials.AUTHENTICATION_ATTRIBUTE_REMEMBER_ME));
    }
   
    public void testWithFalseRememberMeCredentials() {
        final Authentication auth = new MutableAuthentication(TestUtils.getPrincipal());
        final RememberMeUsernamePasswordCredentials c = new RememberMeUsernamePasswordCredentials();
        c.setRememberMe(false);
       
        final Authentication auth2 = this.p.populateAttributes(auth, c);
       
View Full Code Here

        assertNull(auth2.getAttributes().get(RememberMeCredentials.AUTHENTICATION_ATTRIBUTE_REMEMBER_ME));
    }

   
    public void testWithoutRememberMeCredentials() {
        final Authentication auth = new MutableAuthentication(TestUtils.getPrincipal());       
        final Authentication auth2 = this.p.populateAttributes(auth, TestUtils.getCredentialsWithSameUsernameAndPassword());
       
        assertNull(auth2.getAttributes().get(RememberMeCredentials.AUTHENTICATION_ATTRIBUTE_REMEMBER_ME));
    }
View Full Code Here

        attributes.put("testAttribute", "testValue");
        attributes.put("testEmptyCollection", Collections.emptyList());
        attributes.put("testAttributeCollection", Arrays.asList(new String[] {"tac1", "tac2"}));
        final SimplePrincipal principal = new SimplePrincipal("testPrincipal", attributes);
       
        final MutableAuthentication authentication = new MutableAuthentication(principal);
        authentication.getAttributes().put(SamlAuthenticationMetaDataPopulator.ATTRIBUTE_AUTHENTICATION_METHOD, SAMLAuthenticationStatement.AuthenticationMethod_SSL_TLS_Client);
        authentication.getAttributes().put("testSamlAttribute", "value");
       
        final List<Authentication> authentications = new ArrayList<Authentication>();
        authentications.add(authentication);
       
        final Assertion assertion = new ImmutableAssertionImpl(authentications, TestUtils.getService(), true);
View Full Code Here

    public void testResponseWithNoAttributes() throws Exception {
        final Map<String, Object> model = new HashMap<String, Object>();
       
        final SimplePrincipal principal = new SimplePrincipal("testPrincipal");
       
        final MutableAuthentication authentication = new MutableAuthentication(principal);
        authentication.getAttributes().put(SamlAuthenticationMetaDataPopulator.ATTRIBUTE_AUTHENTICATION_METHOD, SAMLAuthenticationStatement.AuthenticationMethod_SSL_TLS_Client);
        authentication.getAttributes().put("testSamlAttribute", "value");
       
        final List<Authentication> authentications = new ArrayList<Authentication>();
        authentications.add(authentication);
       
        final Assertion assertion = new ImmutableAssertionImpl(authentications, TestUtils.getService(), true);
View Full Code Here

       
        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);
       
        final Assertion assertion = new ImmutableAssertionImpl(authentications, TestUtils.getService(), true);
       
View Full Code Here

        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);
       
        final Assertion assertion = new ImmutableAssertionImpl(authentications, TestUtils.getService(), true);
       
View Full Code Here

TOP

Related Classes of org.jasig.cas.authentication.MutableAuthentication

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.