Examples of AuthnContextTypeSequence


Examples of org.picketlink.identity.federation.saml.v2.assertion.AuthnContextType.AuthnContextTypeSequence

                startElement = StaxParserUtil.getNextStartElement(xmlEventReader);

                Element dom = StaxParserUtil.getDOMElement(xmlEventReader);

                AuthnContextDeclType authnContextDecl = new AuthnContextDeclType(dom);
                AuthnContextTypeSequence authnContextSequence = authnContextType.new AuthnContextTypeSequence();
                authnContextSequence.setAuthnContextDecl(authnContextDecl);
                authnContextType.setSequence(authnContextSequence);

                EndElement endElement = StaxParserUtil.getNextEndElement(xmlEventReader);
                StaxParserUtil.validate(endElement, JBossSAMLConstants.AUTHN_CONTEXT_DECLARATION.get());
            } else if (JBossSAMLConstants.AUTHN_CONTEXT_DECLARATION_REF.get().equals(tag)) {
                startElement = StaxParserUtil.getNextStartElement(xmlEventReader);
                String text = StaxParserUtil.getElementText(xmlEventReader);

                AuthnContextDeclRefType aAuthnContextDeclType = new AuthnContextDeclRefType(URI.create(text));
                authnContextType.addURIType(aAuthnContextDeclType);
            } else if (JBossSAMLConstants.AUTHN_CONTEXT_CLASS_REF.get().equals(tag)) {
                startElement = StaxParserUtil.getNextStartElement(xmlEventReader);
                String text = StaxParserUtil.getElementText(xmlEventReader);

                AuthnContextClassRefType aAuthnContextClassRefType = new AuthnContextClassRefType(URI.create(text));
                AuthnContextTypeSequence authnContextSequence = authnContextType.new AuthnContextTypeSequence();
                authnContextSequence.setClassRef(aAuthnContextClassRefType);

                authnContextType.setSequence(authnContextSequence);
            } else
                throw logger.parserUnknownTag(tag, startElement.getLocation());
        }
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v2.assertion.AuthnContextType.AuthnContextTypeSequence

     * @throws ProcessingException
     */
    public void write(AuthnContextType authContext) throws ProcessingException {
        StaxUtil.writeStartElement(writer, ASSERTION_PREFIX, JBossSAMLConstants.AUTHN_CONTEXT.get(), ASSERTION_NSURI.get());

        AuthnContextTypeSequence sequence = authContext.getSequence();
        if (sequence != null) {
            AuthnContextClassRefType authnContextClassRefType = sequence.getClassRef();
            if (authnContextClassRefType != null) {
                StaxUtil.writeStartElement(writer, ASSERTION_PREFIX, JBossSAMLConstants.AUTHN_CONTEXT_CLASS_REF.get(),
                        ASSERTION_NSURI.get());
                StaxUtil.writeCharacters(writer, authnContextClassRefType.getValue().toASCIIString());
                StaxUtil.writeEndElement(writer);
            }

            Set<URIType> uriTypes = sequence.getURIType();
            if (uriTypes != null) {
                for (URIType uriType : uriTypes) {
                    if (uriType instanceof AuthnContextDeclType) {
                        StaxUtil.writeStartElement(writer, ASSERTION_PREFIX,
                                JBossSAMLConstants.AUTHN_CONTEXT_DECLARATION.get(), ASSERTION_NSURI.get());
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v2.assertion.AuthnContextType.AuthnContextTypeSequence

        for (StatementAbstractType statement : statements) {
            if (statement instanceof AuthnStatementType) {
                AuthnStatementType authnStat = (AuthnStatementType) statement;
                AuthnContextType authnContext = authnStat.getAuthnContext();

                AuthnContextTypeSequence sequence = authnContext.getSequence();
                assertNotNull(sequence);
                assertEquals("urn:federation:authentication:windows", sequence.getClassRef().getValue().toString());
            } else if (statement instanceof AttributeStatementType) {
                AttributeStatementType attribStat = (AttributeStatementType) statement;
                List<ASTChoiceType> attributes = attribStat.getAttributes();
                assertEquals(2, attributes.size());
                for (ASTChoiceType astChoice : attributes) {
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v2.assertion.AuthnContextType.AuthnContextTypeSequence

        AuthnStatementType authnStatement = new AuthnStatementType(instant);

        AuthnContextType authnContext = new AuthnContextType();
        AuthnContextClassRefType authnContextClassRef = new AuthnContextClassRefType(URI.create(authnContextClassRefValue));

        AuthnContextTypeSequence sequence = (authnContext).new AuthnContextTypeSequence();
        sequence.setClassRef(authnContextClassRef);
        authnContext.setSequence(sequence);

        authnStatement.setAuthnContext(authnContext);

        return authnStatement;
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v2.assertion.AuthnContextType.AuthnContextTypeSequence

        AuthnStatementType authnStatement = new AuthnStatementType(issueInstant);
        AuthnContextType act = new AuthnContextType();
        String authContextDeclRef = JBossSAMLURIConstants.AC_PASSWORD_PROTECTED_TRANSPORT.get();
        act.addAuthenticatingAuthority(URI.create(authContextDeclRef));

        AuthnContextTypeSequence sequence = act.new AuthnContextTypeSequence();
        sequence.setClassRef(new AuthnContextClassRefType(URI.create(JBossSAMLURIConstants.AC_PASSWORD.get())));
        act.setSequence(sequence);

        authnStatement.setAuthnContext(act);
        return authnStatement;
    }
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.