@SuppressWarnings("unchecked") private void doSSO(HttpServletRequest request, HttpServletResponse response, Authentication authentication, boolean postRequest) throws ValidationException, SecurityException, MessageDecodingException, MarshallingException, SignatureException, MessageEncodingException, MetadataProviderException, IOException, ServletException { SAMLMessageContext messageContext = samlMessageHandler.extractSAMLMessageContext(request, response, postRequest); AuthnRequest authnRequest = (AuthnRequest) messageContext.getInboundSAMLMessage(); String assertionConsumerServiceURL = idpConfiguration.getAcsEndpoint() != null ? idpConfiguration.getAcsEndpoint() : authnRequest.getAssertionConsumerServiceURL(); List<SAMLAttribute> attributes = attributes(authentication); SAMLPrincipal principal = new SAMLPrincipal( authentication.getName(), attributes.stream().filter(attr -> "urn:oasis:names:tc:SAML:1.1:nameid-format".equals(attr.getName())) .findFirst().map(attr -> attr.getValue()).orElse(NameIDType.UNSPECIFIED), attributes, authnRequest.getIssuer().getValue(), authnRequest.getID(), assertionConsumerServiceURL, messageContext.getRelayState()); samlMessageHandler.sendAuthnResponse(principal, response); }
setRequestIssuer(authnRequest.getIssuer().getValue(), request.getSession()); setRequestId(authnRequest.getID(), request.getSession());
Issuer issuer = authnRequest.getIssuer(); Subject subject = authnRequest.getSubject(); false, String.format(SAMLValidatorConstants.ValidationMessage.VAL_IDP_CONFIGS_FAIL, authnRequest.getIssuer() .getValue()))); throw IdentityException.error(SAMLValidatorConstants.ValidationMessage.EXIT_WITH_ERROR); false, String.format(SAMLValidatorConstants.ValidationMessage.VAL_IDP_CONFIGS_FAIL, authnRequest.getIssuer() .getValue()))); throw IdentityException.error(SAMLValidatorConstants.ValidationMessage.EXIT_WITH_ERROR); true, String.format(SAMLValidatorConstants.ValidationMessage.VAL_IDP_CONFIGS_SUCCESS, authnRequest.getIssuer() .getValue())));
Issuer issuer = authnRequest.getIssuer(); Subject subject = authnRequest.getSubject(); false, String.format(SAMLValidatorConstants.ValidationMessage.VAL_IDP_CONFIGS_FAIL, authnRequest.getIssuer() .getValue()))); throw IdentityException.error(SAMLValidatorConstants.ValidationMessage.EXIT_WITH_ERROR); false, String.format(SAMLValidatorConstants.ValidationMessage.VAL_IDP_CONFIGS_FAIL, authnRequest.getIssuer() .getValue()))); throw IdentityException.error(SAMLValidatorConstants.ValidationMessage.EXIT_WITH_ERROR); true, String.format(SAMLValidatorConstants.ValidationMessage.VAL_IDP_CONFIGS_SUCCESS, authnRequest.getIssuer() .getValue())));
SPInitRequest spInitRequest = ((SPInitRequest) saml2SSOContext.getRequest()); AuthnRequest authnRequest = spInitRequest.getAuthnRequest(); Issuer issuer = authnRequest.getIssuer(); if (issuer == null || (StringUtils.isBlank(issuer.getValue()) && StringUtils.isBlank(issuer.getSPProvidedID()))) {