PicketLink Federation Core 2.1.6.Final-redhat-2

org.picketlink.identity.federation.api.wstrust
Class WSTrustClient

java.lang.Object
  extended by org.picketlink.identity.federation.api.wstrust.WSTrustClient

public class WSTrustClient
extends Object

WS-Trust Client

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

Nested Class Summary
static class WSTrustClient.SecurityInfo
           
 
Constructor Summary
WSTrustClient(String serviceName, String port, String[] endpointURIs, WSTrustClient.SecurityInfo secInfo)
           
WSTrustClient(String serviceName, String port, String endpointURI, WSTrustClient.SecurityInfo secInfo)
           
 
Method Summary
 boolean cancelToken(Element token)
           This method sends a WS-Trust cancel message to the STS in order to cancel (revoke) the specified security token.
 Element issueToken(RequestSecurityToken request)
           Issues a security token using the specified RequestSecurityToken object.
 Element issueToken(String tokenType)
          This method will send a RequestSecurityToken with a RequestType of issue and the passed-in tokenType identifies the type of token to be issued by the STS.
 Element issueToken(String endpointURI, String tokenType)
          Issues a Security Token from the STS.
 Element issueTokenForEndpoint(String endpointURI)
          This method will send a RequestSecurityToken with a RequestType of issue and the passed-in endpointURI identifies 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)
          This method will send a RequestSecurityToken with a RequestType of renew and the passed-in tokenType identifies the type of token to be renewed by the STS.
 boolean validateToken(Element token)
          This method will send a RequestSecurityToken with a RequestType of validated by the STS.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WSTrustClient

public WSTrustClient(String serviceName,
                     String port,
                     String endpointURI,
                     WSTrustClient.SecurityInfo secInfo)
              throws ParsingException
Throws:
ParsingException

WSTrustClient

public WSTrustClient(String serviceName,
                     String port,
                     String[] endpointURIs,
                     WSTrustClient.SecurityInfo secInfo)
              throws ParsingException
Throws:
ParsingException
Method Detail

issueToken

public Element issueToken(String tokenType)
                   throws WSTrustException
This method will send a RequestSecurityToken with a RequestType of issue and the passed-in tokenType identifies the type of token to be issued by the STS.

Parameters:
tokenType - - The type of token to be issued.
Returns:
Element - The Security Token element. Will be of the tokenType specified.
Throws:
WSTrustException

issueTokenForEndpoint

public Element issueTokenForEndpoint(String endpointURI)
                              throws WSTrustException
This method will send a RequestSecurityToken with a RequestType of issue and the passed-in endpointURI identifies 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. Will be of the tokenType configured for the endpointURI.
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 both or one 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:
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 security token to be issued.
principal - - The Principal on behalf of whom the token is to be issued.
Returns:
an Element representing the issued security token.
Throws:
WSTrustException - if a processing error occurs while issuing the security token.

issueToken

public Element issueToken(RequestSecurityToken request)
                   throws WSTrustException

Issues a security token using the specified RequestSecurityToken object.

Parameters:
request - an instance of RequestSecurityToken that contains the WS-Trust request information.
Returns:
an Element representing the issued security token.
Throws:
IllegalArgumentException - if the specified request is null.
WSTrustException - if a processing error occurs while issuing the token.

renewToken

public Element renewToken(String tokenType,
                          Element token)
                   throws WSTrustException
This method will send a RequestSecurityToken with a RequestType of renew and the passed-in tokenType identifies the type of token to be renewed by the STS.

Parameters:
tokenType - - The type of token to be renewed.
token - - The security token to be renewed.
Returns:
Element - The Security Token element. Will be of the tokenType specified.
Throws:
WSTrustException

validateToken

public boolean validateToken(Element token)
                      throws WSTrustException
This method will send a RequestSecurityToken with a RequestType of validated by the STS.

Parameters:
token - - The security token to be validated.
Returns:
true - If the security token was sucessfully valiated.
Throws:
WSTrustException

cancelToken

public boolean cancelToken(Element token)
                    throws WSTrustException

This method sends a WS-Trust cancel message to the STS in order to cancel (revoke) the specified security token.

Parameters:
token - the security token to be canceled.
Returns:
true if the token was successfully canceled; false otherwise.
Throws:
WSTrustException - if an error occurs while canceling the security token.

PicketLink Federation Core 2.1.6.Final-redhat-2

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