Examples of RequestSecurityToken


Examples of org.jboss.identity.federation.core.wstrust.wrappers.RequestSecurityToken

    }
   
    public Element issueToken(String tokenType) throws WSTrustException
    {
        // create a custom token request message.
        RequestSecurityToken request = new RequestSecurityToken();
        setTokenType(tokenType, request);
        // send the token request to JBoss STS and get the response.
        return issueToken(request);
    }
View Full Code Here

Examples of org.jboss.identity.federation.core.wstrust.wrappers.RequestSecurityToken

        return (Element) rstr.getFirstChild();
    }

    public Element renewToken(String tokenType, Element token) throws WSTrustException
    {
        RequestSecurityToken request = new RequestSecurityToken();
        request.setContext("context");

        request.setTokenType(URI.create(WSTrustConstants.STATUS_TYPE));
        request.setRequestType(URI.create(WSTrustConstants.RENEW_REQUEST));
        RenewTargetType renewTarget = new RenewTargetType();
        renewTarget.setAny(token);
        request.setRenewTarget(renewTarget);

        // send the token request to JBoss STS and get the response.
        WSTrustJAXBFactory jaxbFactory = WSTrustJAXBFactory.getInstance();
        DOMSource requestSource = (DOMSource) jaxbFactory.marshallRequestSecurityToken(request);
        Source response = dispatchLocal.get().invoke(requestSource);
View Full Code Here

Examples of org.jboss.identity.federation.core.wstrust.wrappers.RequestSecurityToken

        
         jaxbRST = (JAXBElement<RequestSecurityTokenType>) binder.unmarshal(rst);

         RequestSecurityTokenType rstt = jaxbRST.getValue();
         holders.set(new SAMLDocumentHolder(rstt, document));
         return new RequestSecurityToken(rstt);
      }
      catch (JAXBException e)
      {
         throw new ParsingException(e);
      }
View Full Code Here

Examples of org.opensaml.ws.wstrust.RequestSecurityToken

*/
public class RequestSecurityTokenMarshaller extends AbstractWSTrustObjectMarshaller {

    /** {@inheritDoc} */
    protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
        RequestSecurityToken rst = (RequestSecurityToken) xmlObject;
        if (rst.getContext() != null) {
            domElement.setAttributeNS(null, RequestSecurityToken.CONTEXT_ATTRIB_NAME, rst.getContext());
        }
       
        XMLHelper.marshallAttributeMap(rst.getUnknownAttributes(), domElement);
    }
View Full Code Here

Examples of org.opensaml.ws.wstrust.RequestSecurityToken

*/
public class RequestSecurityTokenUnmarshaller extends AbstractWSTrustObjectUnmarshaller {

    /** {@inheritDoc} */
    protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException {
        RequestSecurityToken rst = (RequestSecurityToken) xmlObject;
        if (RequestSecurityToken.CONTEXT_ATTRIB_NAME.equals(attribute.getLocalName())) {
            rst.setContext(attribute.getValue());
        } else {
            XMLHelper.unmarshallToAttributeMap(rst.getUnknownAttributes(), attribute);
        }
    }
View Full Code Here

Examples of org.opensaml.ws.wstrust.RequestSecurityToken

    }

    /** {@inheritDoc} */
    protected void processChildElement(XMLObject parentXMLObject, XMLObject childXMLObject)
            throws UnmarshallingException {
        RequestSecurityToken rst = (RequestSecurityToken) parentXMLObject;
        rst.getUnknownXMLObjects().add(childXMLObject);
    }
View Full Code Here

Examples of org.opensaml.ws.wstrust.RequestSecurityToken

*/
public class RequestSecurityTokenUnmarshaller extends AbstractWSTrustObjectUnmarshaller {

    /** {@inheritDoc} */
    protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException {
        RequestSecurityToken rst = (RequestSecurityToken) xmlObject;
        if (RequestSecurityToken.CONTEXT_ATTRIB_NAME.equals(attribute.getLocalName())) {
            rst.setContext(attribute.getValue());
        } else {
            XMLHelper.unmarshallToAttributeMap(rst.getUnknownAttributes(), attribute);
        }
    }
View Full Code Here

Examples of org.opensaml.ws.wstrust.RequestSecurityToken

    }

    /** {@inheritDoc} */
    protected void processChildElement(XMLObject parentXMLObject, XMLObject childXMLObject)
            throws UnmarshallingException {
        RequestSecurityToken rst = (RequestSecurityToken) parentXMLObject;
        rst.getUnknownXMLObjects().add(childXMLObject);
    }
View Full Code Here

Examples of org.opensaml.ws.wstrust.RequestSecurityToken

*/
public class RequestSecurityTokenMarshaller extends AbstractWSTrustObjectMarshaller {

    /** {@inheritDoc} */
    protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
        RequestSecurityToken rst = (RequestSecurityToken) xmlObject;
        if (rst.getContext() != null) {
            domElement.setAttributeNS(null, RequestSecurityToken.CONTEXT_ATTRIB_NAME, rst.getContext());
        }
       
        XMLHelper.marshallAttributeMap(rst.getUnknownAttributes(), domElement);
    }
View Full Code Here

Examples of org.picketlink.identity.federation.core.wstrust.wrappers.RequestSecurityToken

      new SecurityInfo("UserB", "PassB"));
   
    Element assertion = null;
    try
    {
      RequestSecurityToken request = new RequestSecurityToken();
      request.setTokenType(URI.create(SAMLUtil.SAML2_TOKEN_TYPE));
      AttributedString as = new AttributedString();
      as.setValue("UserA");
      as.setId("UserA");
      UsernameTokenType utt = new UsernameTokenType();
      utt.setUsername(as);
      utt.setId("UserA");
      OnBehalfOfType obot = new OnBehalfOfType();
      obot.add(utt);
      request.setOnBehalfOf(obot);
      assertion = client.issueToken(request);
    }
    catch (WSTrustException wse)
    {
      log.error("Unable to issue assertion: ", wse);
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.