Examples of WSTrustRequestHandler


Examples of org.jboss.identity.federation.api.wstrust.WSTrustRequestHandler

         catch (ConfigurationException e)
         {
            throw new WebServiceException("Encountered configuration exception:", e);
         }
     
      WSTrustRequestHandler handler = this.config.getRequestHandler();
      String requestType = request.getRequestType().toString();

      try
      {
         if (requestType.equals(WSTrustConstants.ISSUE_REQUEST))
            return this.marshallResponse(handler.issue(request, this.context.getUserPrincipal()));
         else if (requestType.equals(WSTrustConstants.RENEW_REQUEST))
            return this.marshallResponse(handler.renew(request, this.context.getUserPrincipal()));
         else if (requestType.equals(WSTrustConstants.CANCEL_REQUEST))
            return this.marshallResponse(handler.cancel(request, this.context.getUserPrincipal()));
         else if (requestType.equals(WSTrustConstants.VALIDATE_REQUEST))
            return this.marshallResponse(handler.validate(request, this.context.getUserPrincipal()));
         else
            throw new WSTrustException("Invalid request type: " + requestType);
      }
      catch (WSTrustException we)
      {
View Full Code Here

Examples of org.jboss.identity.federation.core.wstrust.WSTrustRequestHandler

         catch (ConfigurationException e)
         {
            throw new WebServiceException("Encountered configuration exception:", e);
         }
     
      WSTrustRequestHandler handler = this.config.getRequestHandler();
      String requestType = request.getRequestType().toString();

      try
      {
         if (requestType.equals(WSTrustConstants.ISSUE_REQUEST))
         {
            Source source = this.marshallResponse(handler.issue(request, this.context.getUserPrincipal()));
            Document doc = handler.postProcess((Document)((DOMSource)source).getNode(), request);
            return new DOMSource(doc);   
        
        
         else if (requestType.equals(WSTrustConstants.RENEW_REQUEST))
            return this.marshallResponse(handler.renew(request, this.context.getUserPrincipal()));
         else if (requestType.equals(WSTrustConstants.CANCEL_REQUEST))
            return this.marshallResponse(handler.cancel(request, this.context.getUserPrincipal()));
         else if (requestType.equals(WSTrustConstants.VALIDATE_REQUEST))
            return this.marshallResponse(handler.validate(request, this.context.getUserPrincipal()));
         else
            throw new WSTrustException("Invalid request type: " + requestType);
      }
      catch (WSTrustException we)
      {
View Full Code Here

Examples of org.picketlink.identity.federation.core.wstrust.WSTrustRequestHandler

        STSConfiguration config = new PicketLinkSTSConfiguration(stsType);
        WSTrustServiceFactory factory = WSTrustServiceFactory.getInstance();

        // tests the creation of the request handler.
        WSTrustRequestHandler handler = factory.createRequestHandler(
                "org.picketlink.identity.federation.core.wstrust.StandardRequestHandler", config);
        assertNotNull("Unexpected null request handler", handler);
        assertTrue("Unexpected request handler type", handler instanceof StandardRequestHandler);

        InputStream is = getClass().getClassLoader().getResourceAsStream("wstrust/wstrust-rst-usekey.xml");
        assertNotNull(is);

        WSTrustParser parser = new WSTrustParser();
        RequestSecurityToken token = (RequestSecurityToken) parser.parse(is);

        RequestSecurityTokenResponse response = handler.issue(token, new Principal() {
            @Override
            public String getName() {
                return "testuser";
            }
        });
View Full Code Here

Examples of org.picketlink.identity.federation.core.wstrust.WSTrustRequestHandler

        // check the values that have been configured.
        assertEquals("Unexpected service name", "Test STS", config.getSTSName());
        assertEquals("Unexpected token timeout value", 7200 * 1000, config.getIssuedTokenTimeout());
        assertFalse("Encrypt token should be true", config.encryptIssuedToken());
        WSTrustRequestHandler handler = config.getRequestHandler();
        assertNotNull("Unexpected null request handler found", handler);
        assertTrue("Unexpected request handler type", handler instanceof StandardRequestHandler);

        // check the token type -> token provider mapping.
        SecurityTokenProvider provider = config.getProviderForTokenType("http://www.tokens.org/SpecialToken");
View Full Code Here

Examples of org.picketlink.identity.federation.core.wstrust.WSTrustRequestHandler

    public void testCreateRequestHandler() throws Exception {
        STSConfiguration config = new PicketLinkSTSConfiguration();
        WSTrustServiceFactory factory = WSTrustServiceFactory.getInstance();

        // tests the creation of the request handler.
        WSTrustRequestHandler handler = factory.createRequestHandler(
                "org.picketlink.identity.federation.core.wstrust.StandardRequestHandler", config);
        assertNotNull("Unexpected null request handler", handler);
        assertTrue("Unexpected request handler type", handler instanceof StandardRequestHandler);

        // try to create an invalid instance of request handler.
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.