public class STSClient extends Object
| Constructor and Description |
|---|
STSClient()
Constructor
|
STSClient(STSClientConfig config)
Constructor that creates the
Dispatch for use. |
| Modifier and Type | Method and Description |
|---|---|
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
|
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 |
boolean |
validateToken(Element token)
Validate a token
|
public STSClient()
#setDispatch(Dispatch)} for the setting of the {@link Dispatch} objectpublic 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
config - public void setDispatch(Dispatch<Source> dispatch)
Dispatch object for usedispatch - public Element issueToken(String tokenType) throws WSTrustException
tokenType - WSTrustExceptionpublic Element issueTokenForEndpoint(String endpointURI) throws WSTrustException
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.WSTrustExceptionpublic Element issueToken(String endpointURI, String tokenType) throws WSTrustException
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.IllegalArgumentException - If neither endpointURI nor tokenType was specified.WSTrustExceptionpublic Element issueTokenOnBehalfOf(String endpointURI, String tokenType, Principal principal) throws WSTrustException
Issues a security token on behalf of the specified principal.
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.Element representing the issued security token.IllegalArgumentException - If neither endpointURI nor tokenType was specified.WSTrustException - if an error occurs while issuing the security token.public Element issueToken(RequestSecurityToken request) throws WSTrustException
request - WSTrustExceptionpublic Element renewToken(String tokenType, Element token) throws WSTrustException
tokenType - token - WSTrustExceptionpublic boolean validateToken(Element token) throws WSTrustException
token - WSTrustExceptionpublic boolean cancelToken(Element securityToken) throws WSTrustException
Cancels the specified security token by sending a WS-Trust cancel message to the STS.
securityToken - the security token to be canceled.true if the token has been canceled by the STS; false otherwise.WSTrustException - if an error occurs while processing the cancel request.Copyright © 2012 JBoss by Red Hat. All Rights Reserved.