Examples of SAML2Request


Examples of org.jboss.identity.federation.api.saml.v2.request.SAML2Request

  
   private RequestAbstractType getSAMLRequest(Request request) throws JAXBException, SAXException
   {
      String samlMessage = getSAMLMessage(request);
      InputStream is = RedirectBindingUtil.base64DeflateDecode(samlMessage);
      SAML2Request saml2Request = new SAML2Request()
      return saml2Request.getRequestType(is);
   }
View Full Code Here

Examples of org.jboss.identity.federation.api.saml.v2.request.SAML2Request

   {
      ResponseType responseType = null;

      String samlMessage = getSAMLMessage(request);
      InputStream is = RedirectBindingUtil.base64DeflateDecode(samlMessage);
      SAML2Request saml2Request = new SAML2Request();
     
      AuthnRequestType authnRequestType = null;
      try
      {
         authnRequestType = saml2Request.getAuthnRequestType(is);
      }
      catch (JAXBException e2)
      {
         throw new ParsingException(e2);
      }
      catch (SAXException e2)
      {
         throw new ParsingException(e2);
      }
      if(authnRequestType == null)
         throw new IllegalStateException("AuthnRequest is null");

      if(log.isTraceEnabled())
      {
         StringWriter sw = new StringWriter();
         try
         {
            saml2Request.marshall(authnRequestType, sw);
         }
         catch (SAXException e)
         {
            log.trace(e);
         }
View Full Code Here

Examples of org.jboss.identity.federation.api.saml.v2.request.SAML2Request

    * @throws GeneralSecurityException
    */
   public static String getSAMLRequestURLWithSignature(AuthnRequestType authRequest, String relayState,
         PrivateKey signingKey) throws SAXException, JAXBException, IOException, GeneralSecurityException
   {
      SAML2Request saml2Request = new SAML2Request();
      
      // Deal with the original request
      StringWriter sw = new StringWriter();
      saml2Request.marshall(authRequest, sw);
     
      //URL Encode the Request
      String urlEncodedRequest = RedirectBindingUtil.deflateBase64URLEncode(sw.toString());
   
      String urlEncodedRelayState = null;
View Full Code Here

Examples of org.jboss.identity.federation.api.saml.v2.request.SAML2Request

   public static AuthnRequestType getRequestFromSignedURL(String signedURL)
   throws JAXBException, SAXException, IOException 
   {
      String samlRequestTokenValue =  getTokenValue(signedURL, "SAMLRequest");
     
      SAML2Request saml2Request = new SAML2Request();
      return saml2Request.getAuthnRequestType(RedirectBindingUtil.urlBase64DeflateDecode(samlRequestTokenValue));
   }
View Full Code Here

Examples of org.jboss.identity.federation.api.saml.v2.request.SAML2Request

      if(serviceURL == null)
         throw new IllegalArgumentException("serviceURL is null");
      if(identityURL == null)
         throw new IllegalArgumentException("identityURL is null");
     
      SAML2Request saml2Request = new SAML2Request();
      String id = IDGenerator.create("ID_");
      return saml2Request.createAuthnRequestType(id, serviceURL, identityURL, serviceURL);
   }
View Full Code Here

Examples of org.jboss.identity.federation.api.saml.v2.request.SAML2Request

   {
      //create a saml request
      if(this.serviceURL == null)
         throw new ServletException("serviceURL is not configured");

      SAML2Request saml2Request = new SAML2Request();
     
      SPUtil spUtil = new SPUtil();
      AuthnRequestType authnRequest = spUtil.createSAMLRequest(serviceURL, identityURL);
      
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      saml2Request.marshall(authnRequest, baos);
      String base64Request = RedirectBindingUtil.deflateBase64URLEncode(baos.toByteArray());
      String destination = authnRequest.getDestination() + getDestination(base64Request, relayState);
      log.debug("Sending to destination="+destination);
        
View Full Code Here

Examples of org.jboss.identity.federation.api.saml.v2.request.SAML2Request

   }
  
   protected void sendRequestToIDP(AuthnRequestType authnRequest, String relayState, Response response)
   throws IOException, SAXException, JAXBException, GeneralSecurityException
   {
      SAML2Request saml2Request = new SAML2Request();
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      saml2Request.marshall(authnRequest, baos);
      String samlMessage = PostBindingUtil.base64Encode(baos.toString())
      String destination = authnRequest.getDestination();
     
      //Get the signing key 
View Full Code Here

Examples of org.jboss.identity.federation.api.saml.v2.request.SAML2Request

  
   public RequestAbstractType getSAMLRequest(String samlMessage)
   throws ParsingException
   {
      InputStream is = null;
      SAML2Request saml2Request = new SAML2Request()
      if(redirectProfile)
      {
         is = RedirectBindingUtil.base64DeflateDecode(samlMessage);
      }
      else
      {
         byte[] samlBytes = PostBindingUtil.base64Decode(samlMessage);
         log.trace("SAMLRequest=" + new String(samlBytes));
         is = new ByteArrayInputStream(samlBytes);
      }

      try
      {
         return saml2Request.getRequestType(is);
      }
      catch (JAXBException e)
      {
         throw new ParsingException(e);
      }
View Full Code Here

Examples of org.jboss.identity.federation.api.saml.v2.request.SAML2Request

   }
  
   protected void sendRequestToIDP(AuthnRequestType authnRequest, String relayState, Response response)
   throws IOException, SAXException, JAXBException,GeneralSecurityException
   {
      SAML2Request saml2Request = new SAML2Request();
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      saml2Request.marshall(authnRequest, baos);
      String samlMessage = PostBindingUtil.base64Encode(baos.toString())
      String destination = authnRequest.getDestination();
      PostBindingUtil.sendPost(new DestinationInfoHolder(destination, samlMessage, relayState),
             null,response, true);
View Full Code Here

Examples of org.jboss.identity.federation.api.saml.v2.request.SAML2Request

      if(serviceURL == null)
         throw new IllegalArgumentException("serviceURL is null");
      if(identityURL == null)
         throw new IllegalArgumentException("identityURL is null");
     
      SAML2Request saml2Request = new SAML2Request();
      String id = IDGenerator.create("ID_");
      return saml2Request.createAuthnRequestType(id, serviceURL, identityURL, serviceURL);
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.