use of org.keycloak.dom.saml.v2.protocol.ArtifactResponseType in project keycloak by keycloak.
the class ArtifactBindingTest method testArtifactBindingLoginGetArtifactResponseTwice.
@Test
public void testArtifactBindingLoginGetArtifactResponseTwice() {
SamlClientBuilder clientBuilder = new SamlClientBuilder();
HandleArtifactStepBuilder handleArtifactBuilder = new HandleArtifactStepBuilder(getAuthServerSamlEndpoint(REALM_NAME), SAML_CLIENT_ID_SALES_POST, clientBuilder);
SAMLDocumentHolder response = clientBuilder.authnRequest(getAuthServerSamlEndpoint(REALM_NAME), SAML_CLIENT_ID_SALES_POST, SAML_ASSERTION_CONSUMER_URL_SALES_POST, SamlClient.Binding.REDIRECT).setProtocolBinding(JBossSAMLURIConstants.SAML_HTTP_ARTIFACT_BINDING.getUri()).build().login().user(bburkeUser).build().handleArtifact(handleArtifactBuilder).build().processSamlResponse(ARTIFACT_RESPONSE).transformObject(ob -> {
assertThat(ob, isSamlResponse(JBossSAMLURIConstants.STATUS_SUCCESS));
return null;
}).build().handleArtifact(handleArtifactBuilder).replayPost(true).build().doNotFollowRedirects().executeAndTransform(this::getArtifactResponse);
assertThat(response.getSamlObject(), instanceOf(ArtifactResponseType.class));
ArtifactResponseType artifactResponse = (ArtifactResponseType) response.getSamlObject();
assertThat(artifactResponse, isSamlStatusResponse(JBossSAMLURIConstants.STATUS_SUCCESS));
assertThat(artifactResponse.getAny(), nullValue());
}
Aggregations