PicketLink Federation Core 2.1.6.Final-redhat-2

org.picketlink.identity.federation.core.wstrust
Class STSClient

java.lang.Object
  extended by org.picketlink.identity.federation.core.wstrust.STSClient

public class STSClient
extends Object

WS-Trust Client

Since:
Aug 29, 2009
Author:
Anil.Saldhana@redhat.com

Constructor Summary
STSClient()
          Constructor
STSClient(STSClientConfig config)
           Constructor that creates the Dispatch for use.
 
Method Summary
 boolean cancelToken(Element securityToken)
           Cancels the specified security token by sending a WS-Trust cancel message to the STS.
 Dispatch<Source> getDispatch()
          Get the dispatch object
 String getSoapBinding()
           
 Element issueToken(RequestSecurityToken request)
          Issue a token
 Element issueToken(String tokenType)
          Issue a token
 Element issueToken(String endpointURI, String tokenType)
          Issues a Security Token from the STS.
 Element issueTokenForEndpoint(String endpointURI)
          Issues a Security Token for the ultimate recipient of the token.
 Element issueTokenOnBehalfOf(String endpointURI, String tokenType, Principal principal)
           Issues a security token on behalf of the specified principal.
 Element renewToken(String tokenType, Element token)
          Renew a token
 void setDispatch(Dispatch<Source> dispatch)
          Set the Dispatch object for use
 void setSoapBinding(String soapBinding)
           
 boolean validateToken(Element token)
          Validate a token
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

STSClient

public STSClient()
Constructor

See Also:
#setDispatch(Dispatch)} for the setting of the {@link Dispatch} object

STSClient

public STSClient(STSClientConfig config)

Constructor that creates the Dispatch for use.

If you need to customize the ws properties, it is suggested to preconstruct a Dispatch object and use the default no-arg constructor followed by a setDispatch(Dispatch) call

Parameters:
config -
Method Detail

setDispatch

public void setDispatch(Dispatch<Source> dispatch)
Set the Dispatch object for use

Parameters:
dispatch -

issueToken

public Element issueToken(String tokenType)
                   throws WSTrustException
Issue a token

Parameters:
tokenType -
Returns:
Throws:
WSTrustException

issueTokenForEndpoint

public Element issueTokenForEndpoint(String endpointURI)
                              throws WSTrustException
Issues a Security Token for the ultimate recipient of the token.

Parameters:
endpointURI - - The ultimate recipient of the token. This will be set at the AppliesTo for the RequestSecurityToken which is an optional element so it may be null.
Returns:
Element - The Security Token Element which will be of the TokenType configured for the endpointURI passed in.
Throws:
WSTrustException

issueToken

public Element issueToken(String endpointURI,
                          String tokenType)
                   throws WSTrustException
Issues a Security Token from the STS. This methods has the option of specifying one or both of endpointURI/tokenType but at least one must specified.

Parameters:
endpointURI - - The ultimate recipient of the token. This will be set at the AppliesTo for the RequestSecurityToken which is an optional element so it may be null.
tokenType - - The type of security token to be issued.
Returns:
Element - The Security Token Element issued.
Throws:
IllegalArgumentException - If neither endpointURI nor tokenType was specified.
WSTrustException

issueTokenOnBehalfOf

public Element issueTokenOnBehalfOf(String endpointURI,
                                    String tokenType,
                                    Principal principal)
                             throws WSTrustException

Issues a security token on behalf of the specified principal.

Parameters:
endpointURI - the ultimate recipient of the token. This will be set at the AppliesTo for the RequestSecurityToken which is an optional element so it may be null.
tokenType - the type of the token to be issued.
principal - the Principal to whom the token will be issued.
Returns:
an Element representing the issued security token.
Throws:
IllegalArgumentException - If neither endpointURI nor tokenType was specified.
WSTrustException - if an error occurs while issuing the security token.

issueToken

public Element issueToken(RequestSecurityToken request)
                   throws WSTrustException
Issue a token

Parameters:
request -
Returns:
Throws:
WSTrustException

renewToken

public Element renewToken(String tokenType,
                          Element token)
                   throws WSTrustException
Renew a token

Parameters:
tokenType -
token -
Returns:
Throws:
WSTrustException

validateToken

public boolean validateToken(Element token)
                      throws WSTrustException
Validate a token

Parameters:
token -
Returns:
Throws:
WSTrustException

cancelToken

public boolean cancelToken(Element securityToken)
                    throws WSTrustException

Cancels the specified security token by sending a WS-Trust cancel message to the STS.

Parameters:
securityToken - the security token to be canceled.
Returns:
true if the token has been canceled by the STS; false otherwise.
Throws:
WSTrustException - if an error occurs while processing the cancel request.

getDispatch

public Dispatch<Source> getDispatch()
Get the dispatch object

Returns:

getSoapBinding

public String getSoapBinding()

setSoapBinding

public void setSoapBinding(String soapBinding)

PicketLink Federation Core 2.1.6.Final-redhat-2

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.