Package org.opensaml.saml2.core

Examples of org.opensaml.saml2.core.IDPEntry


*/
public class IDPEntryUnmarshaller extends AbstractSAMLObjectUnmarshaller {

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

        if (attribute.getLocalName().equals(IDPEntry.PROVIDER_ID_ATTRIB_NAME)) {
            entry.setProviderID(attribute.getValue());
        } else if (attribute.getLocalName().equals(IDPEntry.NAME_ATTRIB_NAME)) {
            entry.setName(attribute.getValue());
        } else if (attribute.getLocalName().equals(IDPEntry.LOC_ATTRIB_NAME)) {
            entry.setLoc(attribute.getValue());
        } else {
            super.processAttribute(samlObject, attribute);
        }
    }
View Full Code Here


*/
public class IDPEntryMarshaller extends AbstractSAMLObjectMarshaller {

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

        if (entry.getProviderID() != null) {
            domElement.setAttributeNS(null, IDPEntry.PROVIDER_ID_ATTRIB_NAME, entry.getProviderID());
        }
        if (entry.getName() != null) {
            domElement.setAttributeNS(null, IDPEntry.NAME_ATTRIB_NAME, entry.getName());
        }
        if (entry.getLoc() != null) {
            domElement.setAttributeNS(null, IDPEntry.LOC_ATTRIB_NAME, entry.getLoc());
        }
    }
View Full Code Here

        super(namespaceURI, elementLocalName);
    }

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

        if (entry.getProviderID() != null)
            domElement.setAttributeNS(null, IDPEntry.PROVIDER_ID_ATTRIB_NAME, entry.getProviderID());
        if (entry.getName() != null)
            domElement.setAttributeNS(null, IDPEntry.NAME_ATTRIB_NAME, entry.getName());
        if (entry.getLoc() != null)
            domElement.setAttributeNS(null, IDPEntry.LOC_ATTRIB_NAME, entry.getLoc());
    }
View Full Code Here

        super(namespaceURI, elementLocalName);
    }

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

        if (attribute.getLocalName().equals(IDPEntry.PROVIDER_ID_ATTRIB_NAME))
            entry.setProviderID(attribute.getValue());
        else if (attribute.getLocalName().equals(IDPEntry.NAME_ATTRIB_NAME))
            entry.setName(attribute.getValue());
        else if (attribute.getLocalName().equals(IDPEntry.LOC_ATTRIB_NAME))
            entry.setLoc(attribute.getValue());
        else
            super.processAttribute(samlObject, attribute);
    }
View Full Code Here

            throw ExceptionUtils.toNotAuthorizedException(null, null);
        }
    }
   
    private String getIssuer(AssertionWrapper assertionW) {
        Issuer samlIssuer = assertionW.getSaml2().getIssuer();
        return samlIssuer == null ? null : samlIssuer.getValue();
    }
View Full Code Here

        if (issuerBuilder == null) {
            issuerBuilder = (SAMLObjectBuilder<Issuer>)
                builderFactory.getBuilder(Issuer.DEFAULT_ELEMENT_NAME);
           
        }
        Issuer issuer = issuerBuilder.buildObject();
        //
        // The SAML authority that is making the claim(s) in the assertion. The issuer SHOULD
        // be unambiguous to the intended relying parties.
        issuer.setValue(issuerValue);
        return issuer;
    }
View Full Code Here

            xmlObject = saml1;

        } else if (samlVersion.equals(SAMLVersion.VERSION_20)) {
            // Build a SAML v2.0 assertion
            saml2 = SAML2ComponentBuilder.createAssertion();
            Issuer samlIssuer = SAML2ComponentBuilder.createIssuer(issuer);

            // Authn Statement(s)
            List<AuthnStatement> authnStatements =
                SAML2ComponentBuilder.createAuthnStatement(
                    samlCallback.getAuthenticationStatementData()
View Full Code Here

            xmlObject = saml1;

        } else if (samlVersion.equals(SAMLVersion.VERSION_20)) {
            // Build a SAML v2.0 assertion
            saml2 = SAML2ComponentBuilder.createAssertion();
            Issuer samlIssuer = SAML2ComponentBuilder.createIssuer(issuer);

            // Authn Statement(s)
            List<AuthnStatement> authnStatements =
                SAML2ComponentBuilder.createAuthnStatement(
                    samlCallback.getAuthenticationStatementData()
View Full Code Here

        if (issuerBuilder == null) {
            issuerBuilder = (SAMLObjectBuilder<Issuer>)
                builderFactory.getBuilder(Issuer.DEFAULT_ELEMENT_NAME);
           
        }
        Issuer issuer = issuerBuilder.buildObject();
        //
        // The SAML authority that is making the claim(s) in the assertion. The issuer SHOULD
        // be unambiguous to the intended relying parties.
        issuer.setValue(issuerValue);
        return issuer;
    }
View Full Code Here

        if (attributeStatements == null || attributeStatements.isEmpty()) {
            throw new WSSecurityException(WSSecurityException.FAILURE, "invalidSAMLsecurity");
        }
       
        Subject subject = saml2Assertion.getSubject();
        NameID nameID = subject.getNameID();
        String subjectName = nameID.getValue();
        if ("alice".equals(subjectName) || "bob".equals(subjectName)) {
            return validatedCredential;
        }
       
        throw new WSSecurityException(WSSecurityException.FAILURE, "invalidSAMLsecurity");
View Full Code Here

TOP

Related Classes of org.opensaml.saml2.core.IDPEntry

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.