use of uk.gov.ida.hub.samlproxy.contracts.SamlRequestDto in project verify-hub by alphagov.
the class SamlMessageReceiverApiResourceTest method shouldErrorWhenSamlStringIsTooSmall.
@Test
public void shouldErrorWhenSamlStringIsTooSmall() throws Exception {
SamlRequestDto authnRequestWrapper = new SamlRequestDto("too small", "relayState", "ipAddress");
Response clientResponse = postSAML(authnRequestWrapper, Urls.SamlProxyUrls.SAML2_SSO_RECEIVER_API_ROOT);
assertError(clientResponse, ExceptionType.INVALID_SAML);
}
use of uk.gov.ida.hub.samlproxy.contracts.SamlRequestDto in project verify-hub by alphagov.
the class SamlMessageReceiverApiResourceTest method createAuthnRequest.
private SamlRequestDto createAuthnRequest(String issuer, String relayState, String publicCert, String privateKey) throws JsonProcessingException {
String id = AuthnRequestIdGenerator.generateRequestId();
Optional<Boolean> forceAuthentication = Optional.of(false);
Optional<Integer> assertionConsumerServiceIndex = Optional.of(1);
Optional<URI> assertionConsumerServiceUrl = Optional.empty();
String anAuthnRequest = authnRequestFactory.anAuthnRequest(id, issuer, forceAuthentication, assertionConsumerServiceUrl, assertionConsumerServiceIndex, publicCert, privateKey, Endpoints.SSO_REQUEST_ENDPOINT, Optional.empty());
SamlRequestDto authnRequestWrapper = new SamlRequestDto(anAuthnRequest, relayState, "ipAddress");
return authnRequestWrapper;
}
Aggregations