Package nl.surfnet.spring.security.opensaml

Examples of nl.surfnet.spring.security.opensaml.ServiceProviderAuthenticationException


      }
    } else if (isOAuthCallback(request)) {
      SAMLAuthenticatedPrincipal principal = (SAMLAuthenticatedPrincipal) request.getSession().getAttribute(PRINCIPAL_FROM_SAML);
      String authState = (String) request.getSession().getAttribute(RELAY_STATE_FROM_SAML);
      if (principal == null) { //huh
        throw new ServiceProviderAuthenticationException("No principal anymore in the session");
      }
      String userId = principal.getName();
      if (StringUtils.isEmpty(userId)) {
        throw new ServiceProviderAuthenticationException("No userId in SAML assertion!");
      }
      apiClient.oauthCallback(request, userId);
      List<Group20> groups = apiClient.getGroups20(userId, userId);
      if (!CollectionUtils.isEmpty(groups)) {
        for (Group20 group : groups) {
View Full Code Here


    final SAMLMessageHandler samlMessageHandler = openSAMLContext.samlMessageHandler();
    try {
      messageContext = samlMessageHandler.extractSAMLMessageContext(request);
    } catch (MessageDecodingException me) {
      throw new ServiceProviderAuthenticationException("Could not decode SAML Response", me);
    } catch (org.opensaml.xml.security.SecurityException se) {
      throw new ServiceProviderAuthenticationException("Could not decode SAML Response", se);
    }

    LOG.debug("Message received from issuer: " + messageContext.getInboundMessageIssuer());

    if (!(messageContext.getInboundSAMLMessage() instanceof Response)) {
      throw new ServiceProviderAuthenticationException("SAML Message was not a Response.");
    }

    final Response inboundSAMLMessage = (Response) messageContext.getInboundSAMLMessage();

    try {
View Full Code Here

TOP

Related Classes of nl.surfnet.spring.security.opensaml.ServiceProviderAuthenticationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.