Examples of RequestedAuthnContext


Examples of org.opensaml.saml2.core.RequestedAuthnContext

    ) {
        if (requestedAuthnCtxBuilder == null) {
            requestedAuthnCtxBuilder = (SAMLObjectBuilder<RequestedAuthnContext>)
                builderFactory.getBuilder(RequestedAuthnContext.DEFAULT_ELEMENT_NAME);
        }
        RequestedAuthnContext authnCtx = requestedAuthnCtxBuilder.buildObject();
        authnCtx.setComparison(comparison);
       
        if (authnCtxClassRefList != null) {
            List<AuthnContextClassRef> classRefList = authnCtx.getAuthnContextClassRefs();
            if (classRefList == null) {
                classRefList = new ArrayList<AuthnContextClassRef>();
            }
            classRefList.addAll(authnCtxClassRefList);
        }
       
        if (authnCtxDeclRefList != null) {
            List<AuthnContextDeclRef> declRefList = authnCtx.getAuthnContextDeclRefs();
            if (declRefList == null) {
                declRefList = new ArrayList<AuthnContextDeclRef>();
            }
            declRefList.addAll(authnCtxDeclRefList);
        }
View Full Code Here

Examples of org.opensaml.saml2.core.RequestedAuthnContext

       
        AuthnContextClassRef authnCtxClassRef =
            SamlpRequestComponentBuilder.createAuthnCtxClassRef(
                "urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport"
            );
        RequestedAuthnContext authnCtx =
            SamlpRequestComponentBuilder.createRequestedAuthnCtxPolicy(
                AuthnContextComparisonTypeEnumeration.EXACT,
                Collections.singletonList(authnCtxClassRef), null
            );
       
View Full Code Here

Examples of org.opensaml.saml2.core.RequestedAuthnContext

*/
public class RequestedAuthnContextUnmarshaller extends AbstractSAMLObjectUnmarshaller {

    /** {@inheritDoc} */
    protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException {
        RequestedAuthnContext rac = (RequestedAuthnContext) samlObject;

        if (attribute.getLocalName().equals(RequestedAuthnContext.COMPARISON_ATTRIB_NAME)) {
            if ("exact".equals(attribute.getValue())) {
                rac.setComparison(AuthnContextComparisonTypeEnumeration.EXACT);
            } else if ("minimum".equals(attribute.getValue())) {
                rac.setComparison(AuthnContextComparisonTypeEnumeration.MINIMUM);
            } else if ("maximum".equals(attribute.getValue())) {
                rac.setComparison(AuthnContextComparisonTypeEnumeration.MAXIMUM);
            } else if ("better".equals(attribute.getValue())) {
                rac.setComparison(AuthnContextComparisonTypeEnumeration.BETTER);
            } else {
                throw new UnmarshallingException("Saw an invalid value for Comparison attribute: "
                        + attribute.getValue());
            }
        } else {
View Full Code Here

Examples of org.opensaml.saml2.core.RequestedAuthnContext

    }

    /** {@inheritDoc} */
    protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
            throws UnmarshallingException {
        RequestedAuthnContext rac = (RequestedAuthnContext) parentSAMLObject;
        if (childSAMLObject instanceof AuthnContextClassRef) {
            rac.getAuthnContextClassRefs().add((AuthnContextClassRef) childSAMLObject);
        } else if (childSAMLObject instanceof AuthnContextDeclRef) {
            rac.getAuthnContextDeclRefs().add((AuthnContextDeclRef) childSAMLObject);
        } else {
            super.processChildElement(parentSAMLObject, childSAMLObject);
        }
    }
View Full Code Here

Examples of org.opensaml.saml2.core.RequestedAuthnContext

*/
public class RequestedAuthnContextMarshaller extends AbstractSAMLObjectMarshaller {

    /** {@inheritDoc} */
    protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException {
        RequestedAuthnContext rac = (RequestedAuthnContext) samlObject;

        if (rac.getComparison() != null) {
            domElement.setAttributeNS(null, RequestedAuthnContext.COMPARISON_ATTRIB_NAME, rac.getComparison()
                    .toString());
        }
    }
View Full Code Here

Examples of org.opensaml.saml2.core.RequestedAuthnContext

        SAMLObjectBuilder<AuthnRequest> builder = (SAMLObjectBuilder<AuthnRequest>) this.builderFactory
                .getBuilder(AuthnRequest.DEFAULT_ELEMENT_NAME);
        AuthnRequest request = builder.buildObject();
        if (comparisonType != null) {
            RequestedAuthnContext authnContext = new RequestedAuthnContextBuilder().buildObject();
            authnContext.setComparison(comparisonType);

            if (authnContextClassRef != null) {
                AuthnContextClassRef classRef = new AuthnContextClassRefBuilder().buildObject();
                classRef.setAuthnContextClassRef(authnContextClassRef);
                authnContext.getAuthnContextClassRefs().add(classRef);
            }
            request.setRequestedAuthnContext(authnContext);
        }

        request.setID(generateID());
View Full Code Here

Examples of org.opensaml.saml2.core.RequestedAuthnContext

       
        AuthnContextClassRef authnCtxClassRef =
            SamlpRequestComponentBuilder.createAuthnCtxClassRef(
                "urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport"
            );
        RequestedAuthnContext authnCtx =
            SamlpRequestComponentBuilder.createRequestedAuthnCtxPolicy(
                AuthnContextComparisonTypeEnumeration.EXACT,
                Collections.singletonList(authnCtxClassRef), null
            );
       
View Full Code Here

Examples of org.opensaml.saml2.core.RequestedAuthnContext

        super(namespaceURI, elementLocalName);
    }

    /** {@inheritDoc} */
    protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException {
        RequestedAuthnContext rac = (RequestedAuthnContext) samlObject;

        if (rac.getComparison() != null)
            domElement.setAttributeNS(null, RequestedAuthnContext.COMPARISON_ATTRIB_NAME, rac.getComparison()
                    .toString());
    }
View Full Code Here

Examples of org.opensaml.saml2.core.RequestedAuthnContext

        super(namespaceURI, elementLocalName);
    }

    /** {@inheritDoc} */
    protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException {
        RequestedAuthnContext rac = (RequestedAuthnContext) samlObject;

        if (attribute.getLocalName().equals(RequestedAuthnContext.COMPARISON_ATTRIB_NAME)) {
            if ("exact".equals(attribute.getValue()))
                rac.setComparison(AuthnContextComparisonTypeEnumeration.EXACT);
            else if ("minimum".equals(attribute.getValue()))
                rac.setComparison(AuthnContextComparisonTypeEnumeration.MINIMUM);
            else if ("maximum".equals(attribute.getValue()))
                rac.setComparison(AuthnContextComparisonTypeEnumeration.MAXIMUM);
            else if ("better".equals(attribute.getValue()))
                rac.setComparison(AuthnContextComparisonTypeEnumeration.BETTER);
            else
                throw new UnmarshallingException("Saw an invalid value for Comparison attribute: "
                        + attribute.getValue());
        } else
            super.processAttribute(samlObject, attribute);
View Full Code Here

Examples of org.opensaml.saml2.core.RequestedAuthnContext

    }

    /** {@inheritDoc} */
    protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
            throws UnmarshallingException {
        RequestedAuthnContext rac = (RequestedAuthnContext) parentSAMLObject;
        if (childSAMLObject instanceof AuthnContextClassRef)
            rac.getAuthnContextClassRefs().add((AuthnContextClassRef) childSAMLObject);
        else if (childSAMLObject instanceof AuthnContextDeclRef)
            rac.getAuthnContextDeclRefs().add((AuthnContextDeclRef) childSAMLObject);
        else
            super.processChildElement(parentSAMLObject, childSAMLObject);
    }
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.