Package org.jboss.identity.federation.core.wstrust

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


               RequestSecurityTokenResponseCollection collection = new RequestSecurityTokenResponseCollection(
                     (RequestSecurityTokenResponseCollectionType) element.getValue());
               // insert the security token in the parsed response.
               if (tokenElement != null)
               {
                  RequestSecurityTokenResponse parsedResponse = collection.getRequestSecurityTokenResponses().get(0);
                  parsedResponse.getRequestedSecurityToken().setAny(tokenElement);
               }
               return collection;
            }
            else
               throw new RuntimeException("Invalid response type: " + element.getDeclaredType());
View Full Code Here


      if (collection.getRequestSecurityTokenResponses().size() == 0)
         throw new IllegalArgumentException("The response collection must contain at least one response");

      // if the response contains an issued token, we must preserve it from the JAXB marshaling.
      Element tokenElement = null;
      RequestSecurityTokenResponse response = collection.getRequestSecurityTokenResponses().get(0);
      if (response.getRequestedSecurityToken() != null)
      {
         tokenElement = (Element) response.getRequestedSecurityToken().getAny();
         // we don't want to marshall any token - it will be inserted in the DOM document later.
         response.getRequestedSecurityToken().setAny(null);
      }

      Document result = null;
      try
      {
View Full Code Here

         RequestedSecurityTokenType requestedSecurityToken = new RequestedSecurityTokenType();
         requestedSecurityToken.setAny(requestContext.getSecurityToken().getTokenValue());

         // TODO: create proof token and encrypt the token if needed

         RequestSecurityTokenResponse response = new RequestSecurityTokenResponse();
         if (request.getContext() != null)
            response.setContext(request.getContext());

         response.setTokenType(request.getTokenType());
         response.setLifetime(request.getLifetime());
         response.setAppliesTo(appliesTo);
         response.setRequestedSecurityToken(requestedSecurityToken);

         // set the attached and unattached references.
         if (requestContext.getAttachedReference() != null)
            response.setRequestedAttachedReference(requestContext.getAttachedReference());
         if (requestContext.getUnattachedReference() != null)
            response.setRequestedUnattachedReference(requestContext.getUnattachedReference());

         return response;
      }
      else
         throw new WSTrustException("Unable to find a token provider for the token request");
View Full Code Here

         provider.validateToken(context);
         status = context.getStatus();
      }

      // construct and return the response.
      RequestSecurityTokenResponse response = new RequestSecurityTokenResponse();
      if (request.getContext() != null)
         response.setContext(request.getContext());
      response.setTokenType(request.getTokenType());
      response.setStatus(status);

      return response;
   }
View Full Code Here

TOP

Related Classes of org.jboss.identity.federation.core.wstrust.RequestSecurityTokenResponse

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.