Package org.jboss.seam.security.external.jaxb.samlv2.protocol

Examples of org.jboss.seam.security.external.jaxb.samlv2.protocol.RequestAbstractType


            if(userPrincipal != null)
            {
               //Send valid saml response after processing the request
               if(containsSAMLRequestMessage)
               {
                  RequestAbstractType requestAbstractType =  null;
                  try
                  {
                     requestAbstractType = getSAMLRequest(request);
                     boolean isValid = this.validate(request);
                     if(!isValid)
                        throw new GeneralSecurityException("Validity Checks Failed");
                    
                     this.isTrusted(requestAbstractType.getIssuer().getValue());
                    
                     ResponseType responseType = this.getResponse(request, userPrincipal);
                     send(responseType, request.getParameter("RelayState"), response);
                  }
                  catch (Exception e)
                  {
                     log.error("Exception:" ,e);
                     if(requestAbstractType != null)
                        referer = requestAbstractType.getIssuer().getValue();
                     ResponseType errorResponseType = this.getErrorResponse(referer, JBossSAMLURIConstants.STATUS_RESPONDER.get());
                     try
                     {
                        send(errorResponseType, request.getParameter("RelayState"), response);
                     }
View Full Code Here


        
         //Send valid saml response after processing the request
         if(samlMessage != null)
         {
            //Get the SAML Request Message
            RequestAbstractType requestAbstractType =  null;
            ResponseType responseType = null;
           
               try
               {
                  requestAbstractType = webRequestUtil.getSAMLRequest(samlMessage);
                  boolean isValid = validate(request.getRemoteAddr(),
                        new SessionHolder(samlMessage, signature, sigAlg));
                  if(!isValid)
                     throw new GeneralSecurityException("Validation check failed");
                 
                  webRequestUtil.isTrusted(requestAbstractType.getIssuer().getValue());

                  List<String> roles = rg.generateRoles(userPrincipal);
                 
                  log.trace("Roles have been determined:Creating response");
View Full Code Here

         //Send valid saml response after processing the request
         if(samlMessage != null)
         {
            //Get the SAML Request Message
            RequestAbstractType requestAbstractType =  null;
            Document samlResponse = null;
            String destination = null;
            try
            {
               requestAbstractType = webRequestUtil.getSAMLRequest(samlMessage);
               boolean isPost = webRequestUtil.hasSAMLRequestInPostProfile();
               boolean isValid = validate(request.getRemoteAddr(),
                     request.getQueryString(),
                     new SessionHolder(samlMessage, null, null), isPost);
              
               if(!isValid)
                  throw new GeneralSecurityException("Validation check failed");

               webRequestUtil.isTrusted(requestAbstractType.getIssuer().getValue());

              
               List<String> roles = (List<String>) session.getAttribute(ROLES_ID);
               if(roles == null)
               {
View Full Code Here

     
      JAXBContext jaxb = JAXBContext.newInstance(path);
      Unmarshaller un = jaxb.createUnmarshaller();
     
      JAXBElement<RequestAbstractType> jaxbRequestType = (JAXBElement<RequestAbstractType>) un.unmarshal(is);
      RequestAbstractType req = jaxbRequestType.getValue();
      if(req instanceof XACMLAuthzDecisionQueryType == false)
         throw new IllegalStateException("Not of type XACMLAuthzDecisionQueryType");
     
      return (XACMLAuthzDecisionQueryType) req;
   }
View Full Code Here

         //Send valid saml response after processing the request
         if(samlMessage != null)
         {
            //Get the SAML Request Message
            RequestAbstractType requestAbstractType =  null;
            Document samlResponse = null;
            String destination = null;
            try
            {
               requestAbstractType = webRequestUtil.getSAMLRequest(samlMessage);
               boolean isPost = webRequestUtil.hasSAMLRequestInPostProfile();
               boolean isValid = validate(request.getRemoteAddr(),
                     request.getQueryString(),
                     new SessionHolder(samlMessage, null), isPost);
              
               if(!isValid)
                  throw new GeneralSecurityException("Validation check failed");

               webRequestUtil.isTrusted(requestAbstractType.getIssuer().getValue());

              
               List<String> roles = (List<String>) session.getAttribute(ROLES_ID);
               if(roles == null)
               {
View Full Code Here

        
         //Send valid saml response after processing the request
         if(samlMessage != null)
         {
            //Get the SAML Request Message
            RequestAbstractType requestAbstractType =  null;
            Document samlResponse = null;
            String destination = null;
               try
               {
                  requestAbstractType = webRequestUtil.getSAMLRequest(samlMessage);
                  boolean isPost = webRequestUtil.hasSAMLRequestInPostProfile();
                  boolean isValid = validate(request.getRemoteAddr(),
                        request.getQueryString(),
                        new SessionHolder(samlMessage, signature, sigAlg), isPost);
                  if(!isValid)
                     throw new GeneralSecurityException("Validation check failed");
                 
                  webRequestUtil.isTrusted(requestAbstractType.getIssuer().getValue());

                  List<String> roles = rg.generateRoles(userPrincipal);
                 
                  log.trace("Roles have been determined:Creating response");
View Full Code Here

      try
      {
         Binder<Node> binder = getBinder();
         JAXBElement<RequestAbstractType> jaxbAuthnRequestType = (JAXBElement<RequestAbstractType>) binder.unmarshal(samlDocument);
         RequestAbstractType requestType = jaxbAuthnRequestType.getValue();
         samlDocumentHolder = new SAMLDocumentHolder(requestType, samlDocument);
         return requestType;
      }
      catch (JAXBException e)
      {
View Full Code Here

     
      JAXBContext jaxb = JAXBUtil.getJAXBContext(path);
      Unmarshaller un = jaxb.createUnmarshaller();
     
      JAXBElement<RequestAbstractType> jaxbRequestType = (JAXBElement<RequestAbstractType>) un.unmarshal(is);
      RequestAbstractType req = jaxbRequestType.getValue();
      if(req instanceof XACMLAuthzDecisionQueryType == false)
         throw new IllegalStateException("Not of type XACMLAuthzDecisionQueryType");
     
      return (XACMLAuthzDecisionQueryType) req;
   }
View Full Code Here

         else
         //Send valid saml response after processing the request
         if(samlRequestMessage != null)
         {
            //Get the SAML Request Message
            RequestAbstractType requestAbstractType =  null;
            StatusResponseType statusResponseType = null;
           
            try
            {
               samlObject = webRequestUtil.getSAMLObject(samlRequestMessage);
              
               boolean isPost = webRequestUtil.hasSAMLRequestInPostProfile();
               boolean isValid = validate(request.getRemoteAddr(),
                     request.getQueryString(),
                     new SessionHolder(samlRequestMessage, null), isPost);
              
               if(!isValid)
                  throw new GeneralSecurityException("Validation check failed");

               String issuer = null;
               IssuerInfoHolder idpIssuer = new IssuerInfoHolder(this.identityURL);
               ProtocolContext protocolContext = new HTTPContext(request,response, context);
               //Create the request/response
               SAML2HandlerRequest saml2HandlerRequest =
                  new DefaultSAML2HandlerRequest(protocolContext,
                        idpIssuer.getIssuer(), samlObject,
                        HANDLER_TYPE.IDP);
               saml2HandlerRequest.setRelayState(relayState);
              
               Map<String, Object> requestOptions = new HashMap<String, Object>();
               requestOptions.put(GeneralConstants.ROLE_GENERATOR, rg);
               requestOptions.put(GeneralConstants.ASSERTIONS_VALIDITY, this.assertionValidity);
               requestOptions.put(GeneralConstants.CONFIGURATION, this.idpConfiguration);
               Map<String,Object> attribs  = this.attribManager.getAttributes(userPrincipal, attributeKeys);
               requestOptions.put(GeneralConstants.ATTRIBUTES, attribs);
              
               saml2HandlerRequest.setOptions(requestOptions);
              
               List<String> roles = (List<String>) session.getAttribute(GeneralConstants.ROLES_ID);
               if(roles == null)
               {
                  roles = rg.generateRoles(userPrincipal);
                  session.setAttribute(GeneralConstants.ROLES_ID, roles);
               }
              
               SAML2HandlerResponse saml2HandlerResponse = new DefaultSAML2HandlerResponse();

               Set<SAML2Handler> handlers = chain.handlers();
              
               if(samlObject instanceof RequestAbstractType)
               {
                  requestAbstractType = (RequestAbstractType) samlObject;
                  issuer = requestAbstractType.getIssuer().getValue();
                  webRequestUtil.isTrusted(issuer);
                 
                  if(handlers != null)
                  {
                     for(SAML2Handler handler: handlers)
View Full Code Here

            if(userPrincipal != null)
            {
               //Send valid saml response after processing the request
               if(containsSAMLRequestMessage)
               {
                  RequestAbstractType requestAbstractType =  null;
                  try
                  {
                     requestAbstractType = getSAMLRequest(request);
                     boolean isValid = this.validate(request);
                     if(!isValid)
                        throw new GeneralSecurityException("Validity Checks Failed");
                    
                     this.isTrusted(requestAbstractType.getIssuer().getValue());
                    
                     ResponseType responseType = this.getResponse(request, userPrincipal);
                     send(responseType, request.getParameter("RelayState"), response);
                  }
                  catch (Exception e)
                  {
                     log.error("Exception:" ,e);
                     if(requestAbstractType != null)
                        referer = requestAbstractType.getIssuer().getValue();
                     ResponseType errorResponseType = this.getErrorResponse(referer, JBossSAMLURIConstants.STATUS_RESPONDER.get());
                     try
                     {
                        send(errorResponseType, request.getParameter("RelayState"), response);
                     }
View Full Code Here

TOP

Related Classes of org.jboss.seam.security.external.jaxb.samlv2.protocol.RequestAbstractType

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.