use of uk.gov.ida.saml.hub.domain.IdaAuthnRequestFromHub in project verify-hub by alphagov.
the class IdaAuthnRequestTranslatorTest method shouldUseMinimumComparisonTypeAndDuplicateSingleLevelOfAssurance.
@Test
public void shouldUseMinimumComparisonTypeAndDuplicateSingleLevelOfAssurance() {
IdaAuthnRequestFromHubDto idaAuthnRequestFromHubDto = aRequestDto(asList(AuthnContext.LEVEL_2), false);
IdaAuthnRequestFromHub idaAuthnRequestFromHub = idaAuthnRequestTranslator.getIdaAuthnRequestFromHub(idaAuthnRequestFromHubDto, URI.create("http://example.com"), HUB_ENTITY_ID);
assertThat(idaAuthnRequestFromHub.getComparisonType()).isEqualTo(AuthnContextComparisonTypeEnumeration.MINIMUM);
assertThat(idaAuthnRequestFromHub.getLevelsOfAssurance()).containsSequence(AuthnContext.LEVEL_2, AuthnContext.LEVEL_2);
}
use of uk.gov.ida.saml.hub.domain.IdaAuthnRequestFromHub in project verify-hub by alphagov.
the class IdpAuthnRequestGeneratorService method generateSaml.
public SamlRequestDto generateSaml(IdaAuthnRequestFromHubDto idaAuthnRequestFromHubDto) {
URI ssoUri = idpSingleSignOnServiceHelper.getSingleSignOn(idaAuthnRequestFromHubDto.getIdpEntityId());
IdaAuthnRequestFromHub idaAuthnRequestFromHub = idaAuthnRequestTranslator.getIdaAuthnRequestFromHub(idaAuthnRequestFromHubDto, ssoUri, hubEntityId);
String request = idaRequestStringTransformer.apply(idaAuthnRequestFromHub);
return new SamlRequestDto(request, ssoUri);
}
use of uk.gov.ida.saml.hub.domain.IdaAuthnRequestFromHub in project verify-hub by alphagov.
the class IdaAuthnRequestTranslatorTest method shouldUseMinimumComparisonTypeAndLevelsOfAssuranceAsIs.
@Test
public void shouldUseMinimumComparisonTypeAndLevelsOfAssuranceAsIs() {
IdaAuthnRequestFromHubDto idaAuthnRequestFromHubDto = aRequestDto(asList(AuthnContext.LEVEL_1, AuthnContext.LEVEL_2), false);
IdaAuthnRequestFromHub idaAuthnRequestFromHub = idaAuthnRequestTranslator.getIdaAuthnRequestFromHub(idaAuthnRequestFromHubDto, URI.create("http://example.com"), HUB_ENTITY_ID);
assertThat(idaAuthnRequestFromHub.getComparisonType()).isEqualTo(AuthnContextComparisonTypeEnumeration.MINIMUM);
assertThat(idaAuthnRequestFromHub.getLevelsOfAssurance()).containsSequence(AuthnContext.LEVEL_1, AuthnContext.LEVEL_2);
}
use of uk.gov.ida.saml.hub.domain.IdaAuthnRequestFromHub in project verify-hub by alphagov.
the class IdaAuthnRequestTranslatorTest method shouldUseExactComparisonTypeAndLevelsOfAssurance.
@Test
public void shouldUseExactComparisonTypeAndLevelsOfAssurance() {
IdaAuthnRequestFromHubDto idaAuthnRequestFromHubDto = aRequestDto(asList(AuthnContext.LEVEL_2), true);
IdaAuthnRequestFromHub idaAuthnRequestFromHub = idaAuthnRequestTranslator.getIdaAuthnRequestFromHub(idaAuthnRequestFromHubDto, URI.create("http://example.com"), HUB_ENTITY_ID);
assertThat(idaAuthnRequestFromHub.getComparisonType()).isEqualTo(AuthnContextComparisonTypeEnumeration.EXACT);
assertThat(idaAuthnRequestFromHub.getLevelsOfAssurance()).containsSequence(AuthnContext.LEVEL_2);
}
use of uk.gov.ida.saml.hub.domain.IdaAuthnRequestFromHub in project verify-hub by alphagov.
the class IdaAuthnRequestTranslatorTest method shouldUseMinimumComparisonTypeAndSendDuplicateLOAs.
@Test
public void shouldUseMinimumComparisonTypeAndSendDuplicateLOAs() {
IdaAuthnRequestFromHubDto idaAuthnRequestFromHubDto = aRequestDto(asList(AuthnContext.LEVEL_2), false);
IdaAuthnRequestFromHub idaAuthnRequestFromHub = idaAuthnRequestTranslator.getIdaAuthnRequestFromHub(idaAuthnRequestFromHubDto, URI.create("http://example.com"), HUB_ENTITY_ID);
assertThat(idaAuthnRequestFromHub.getComparisonType()).isEqualTo(AuthnContextComparisonTypeEnumeration.MINIMUM);
assertThat(idaAuthnRequestFromHub.getLevelsOfAssurance()).containsSequence(AuthnContext.LEVEL_2, AuthnContext.LEVEL_2);
}
Aggregations