Examples of Assertion


Examples of org.jasig.cas.client.validation.Assertion

        UsernamePasswordAuthenticationToken token2 = new UsernamePasswordAuthenticationToken("Test", "Password", ROLES);
        assertTrue(!token1.equals(token2));
    }

    public void testNotEqualsDueToKey() {
        final Assertion assertion = new AssertionImpl("test");

        CasAuthenticationToken token1 = new CasAuthenticationToken("key", makeUserDetails(), "Password", ROLES,
                makeUserDetails(), assertion);

        CasAuthenticationToken token2 = new CasAuthenticationToken("DIFFERENT_KEY", makeUserDetails(), "Password",
View Full Code Here

Examples of org.jasig.cas.client.validation.Assertion

        assertTrue(!token1.equals(token2));
    }

    public void testNotEqualsDueToAssertion() {
        final Assertion assertion = new AssertionImpl("test");
        final Assertion assertion2 = new AssertionImpl("test");

        CasAuthenticationToken token1 = new CasAuthenticationToken("key", makeUserDetails(), "Password", ROLES,
                makeUserDetails(), assertion);

        CasAuthenticationToken token2 = new CasAuthenticationToken("key", makeUserDetails(), "Password", ROLES,
View Full Code Here

Examples of org.jasig.cas.client.validation.Assertion

        assertTrue(!token1.equals(token2));
    }

    public void testSetAuthenticated() {
        final Assertion assertion = new AssertionImpl("test");
        CasAuthenticationToken token = new CasAuthenticationToken("key", makeUserDetails(), "Password", ROLES,
                makeUserDetails(), assertion);
        assertTrue(token.isAuthenticated());
        token.setAuthenticated(false);
        assertTrue(!token.isAuthenticated());
View Full Code Here

Examples of org.jasig.cas.client.validation.Assertion

        token.setAuthenticated(false);
        assertTrue(!token.isAuthenticated());
    }

    public void testToString() {
        final Assertion assertion = new AssertionImpl("test");
        CasAuthenticationToken token = new CasAuthenticationToken("key", makeUserDetails(), "Password",ROLES,
                makeUserDetails(), assertion);
        String result = token.toString();
        assertTrue(result.lastIndexOf("Credentials (Service/Proxy Ticket):") != -1);
    }
View Full Code Here

Examples of org.jasig.cas.client.validation.Assertion

    protected CasAuthenticationToken getToken() {
        List<String> proxyList = new ArrayList<String>();
        proxyList.add("https://localhost/newPortal/j_spring_cas_security_check");

        User user = new User("rod", "password", true, true, true, true, AuthorityUtils.createAuthorityList("ROLE_ONE", "ROLE_TWO"));
        final Assertion assertion = new AssertionImpl("rod");

        return new CasAuthenticationToken("key", user, "ST-0-ER94xMJmn6pha35CQRoZ",
                AuthorityUtils.createAuthorityList("ROLE_ONE", "ROLE_TWO"), user, assertion);
    }
View Full Code Here

Examples of org.jasig.cas.client.validation.Assertion

    @Test
    public void correctlyExtractsNamedAttributesFromAssertionAndConvertsThemToAuthorities() {
        GrantedAuthorityFromAssertionAttributesUserDetailsService uds =
                new GrantedAuthorityFromAssertionAttributesUserDetailsService(new String[] {"a", "b", "c", "d"});
        uds.setConvertToUpperCase(false);
        Assertion assertion = mock(Assertion.class);
        AttributePrincipal principal = mock(AttributePrincipal.class);
        Map<String, Object> attributes = new HashMap<String, Object>();
        attributes.put("a", Arrays.asList("role_a1", "role_a2"));
        attributes.put("b", "role_b");
        attributes.put("c", "role_c");
        attributes.put("d", null);
        attributes.put("someother", "unused");
        when(assertion.getPrincipal()).thenReturn(principal);
        when(principal.getAttributes()).thenReturn(attributes);
        when(principal.getName()).thenReturn("somebody");
        CasAssertionAuthenticationToken token = new CasAssertionAuthenticationToken(assertion, "ticket");
        UserDetails user = uds.loadUserDetails(token);
        Set<String> roles = AuthorityUtils.authorityListToSet(user.getAuthorities());
View Full Code Here

Examples of org.jasig.cas.validation.Assertion

    private boolean successResponse;

    protected void renderMergedOutputModel(final Map model,
        final HttpServletRequest request, final HttpServletResponse response)
        throws Exception {
        final Assertion assertion = getAssertionFrom(model);

        if (this.successResponse) {
            response.getWriter().print(
                "yes\n"
                    + assertion.getChainedAuthentications().get(0).getPrincipal()
                        .getId() + "\n");
        } else {
            response.getWriter().print("no\n\n");
        }
    }
View Full Code Here

Examples of org.locationtech.udig.catalog.tests.ui.workflow.Assertion

    @Test
    public void testConnectionError() throws MalformedURLException {
        // create a bad context object, lets say a wfs that doesn't exist
        URL context = new URL("http://foo.blah.hehehe/geoserver/wfs"); //$NON-NLS-1$

        Assertion a1 = new Assertion(){
            @Override
            public void run() {
                fail = !(catalogImport.getDialog().getCurrentPage() instanceof ConnectionErrorPage);
            }
        };
View Full Code Here

Examples of org.mitre.medfacts.types.Assertion

            String sofaString = jcas.getDocumentText();
            System.err.println("Converting text string: " + sofaString);
            CharacterOffsetToLineTokenConverterDefaultImpl converter = new CharacterOffsetToLineTokenConverterDefaultImpl(sofaString);
          AnnotationIndex<Annotation> aIndex = jcas.getAnnotationIndex(assertionType);
          for (Annotation a : aIndex) {
            Assertion ai = (Assertion) a;
            int begin = ai.getBegin();
            int end = ai.getEnd();
            LineAndTokenPosition begPos = converter.convert(begin);
            LineAndTokenPosition endPos = converter.convert(end);
            writer.println("c=\"" + sofaString.substring(begin,end) + "\" " + begPos.getLine() + ":" + begPos.getTokenOffset() +
                " " + endPos.getLine() + ":" + endPos.getTokenOffset() + "||t=\"problem\"||a=\"" + ai.getAssertionType() + "\"");
          }
          writer.close();
        } catch (Exception e) {
          throw new RuntimeException(e);
          } finally {
View Full Code Here

Examples of org.opensaml.saml1.core.Assertion

        assertNotNull("RequestedSecurityToken missing", rst);

        OMElement elem = rst.getFirstChildWithName(new QName(XML.SAML_NS, "Assertion"));
        assertNotNull("Missing SAML Assertion", elem);

        Assertion assertion = getAssertionObjectFromOMElement(elem);
        List<AuthenticationStatement> authStmts = assertion.getAuthenticationStatements();
        assertNotNull("At least one Authentication Statement should be present in the assertion",
                   authStmts.get(0));

        SubjectStatement authStmt = authStmts.get(0);
        List<ConfirmationMethod> subConfirmationMethods = authStmt.getSubject().
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.