Search in sources :

Example 1 with PersistentId

use of uk.gov.ida.hub.samlengine.domain.PersistentId in project verify-hub by alphagov.

the class AttributeQueryRequestBuilder method build.

public AttributeQueryRequestDto build(String persistentIdName, String matchingDatasetAssertionId, String authnStatementAssertionId, String requestId) {
    XmlObjectToBase64EncodedStringTransformer<XMLObject> toBase64EncodedStringTransformer = new XmlObjectToBase64EncodedStringTransformer<>();
    final PersistentId persistentId = aPersistentId().withNameId(persistentIdName).buildSamlEnginePersistentId();
    Assertion authnStatementAssertion = AssertionBuilder.anAssertion().withId(authnStatementAssertionId).buildUnencrypted();
    String authnStatementAssertionString = toBase64EncodedStringTransformer.apply(authnStatementAssertion);
    EncryptedAssertion encryptedMdsAssertion = AssertionBuilder.anAssertion().withId(matchingDatasetAssertionId).build();
    String encryptedMdsAssertionString = toBase64EncodedStringTransformer.apply(encryptedMdsAssertion);
    return aHubMatchingServiceRequestDto().withId(requestId).withMatchingServiceEntityId(TestEntityIds.TEST_RP_MS).withPersistentId(persistentId).withEncryptedMatchingDatasetAssertion(encryptedMdsAssertionString).withAuthnStatementAssertion(authnStatementAssertionString).build();
}
Also used : EncryptedAssertion(org.opensaml.saml.saml2.core.EncryptedAssertion) EncryptedAssertion(org.opensaml.saml.saml2.core.EncryptedAssertion) Assertion(org.opensaml.saml.saml2.core.Assertion) XMLObject(org.opensaml.core.xml.XMLObject) XmlObjectToBase64EncodedStringTransformer(uk.gov.ida.saml.serializers.XmlObjectToBase64EncodedStringTransformer) PersistentId(uk.gov.ida.hub.samlengine.domain.PersistentId) PersistentIdBuilder.aPersistentId(uk.gov.ida.hub.samlengine.builders.PersistentIdBuilder.aPersistentId)

Aggregations

XMLObject (org.opensaml.core.xml.XMLObject)1 Assertion (org.opensaml.saml.saml2.core.Assertion)1 EncryptedAssertion (org.opensaml.saml.saml2.core.EncryptedAssertion)1 PersistentIdBuilder.aPersistentId (uk.gov.ida.hub.samlengine.builders.PersistentIdBuilder.aPersistentId)1 PersistentId (uk.gov.ida.hub.samlengine.domain.PersistentId)1 XmlObjectToBase64EncodedStringTransformer (uk.gov.ida.saml.serializers.XmlObjectToBase64EncodedStringTransformer)1