throw new RuntimeException("Invalid SAML Response Message", ve);
}
}
private void sendAuthnRequest(HttpServletResponse response, String authState, String returnUri) throws IOException {
AuthnRequestGenerator authnRequestGenerator = new AuthnRequestGenerator(openSAMLContext.entityId(), timeService,
idService);
EndpointGenerator endpointGenerator = new EndpointGenerator();
final String target = openSAMLContext.getIdpUrl();
Endpoint endpoint = endpointGenerator.generateEndpoint(
SingleSignOnService.DEFAULT_ELEMENT_NAME, target, openSAMLContext.assertionConsumerUri());
AuthnRequest authnRequest = authnRequestGenerator.generateAuthnRequest(target, openSAMLContext.assertionConsumerUri());
Client client = getClientByRequest(authState);
String spEntityIdBy = client.getAttributes().get(CLIENT_SAML_ENTITY_NAME);
if (StringUtils.isNotEmpty(spEntityIdBy)) {