public class WSTrustClient extends Object
Modifier and Type | Class and Description |
---|---|
static class |
WSTrustClient.SecurityInfo |
Constructor and Description |
---|
WSTrustClient(String serviceName,
String port,
String[] endpointURIs,
WSTrustClient.SecurityInfo secInfo) |
WSTrustClient(String serviceName,
String port,
String endpointURI,
WSTrustClient.SecurityInfo secInfo) |
Modifier and Type | Method and Description |
---|---|
boolean |
cancelToken(Element token)
This method sends a WS-Trust cancel message to the STS in order to cancel (revoke) the specified security token.
|
void |
close()
This method returns all allocated clients back to the STSClientPool when pooling is enabled.
|
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.
|
public WSTrustClient(String serviceName, String port, String endpointURI, WSTrustClient.SecurityInfo secInfo) throws ParsingException
ParsingException
public WSTrustClient(String serviceName, String port, String[] endpointURIs, WSTrustClient.SecurityInfo secInfo) throws ParsingException
ParsingException
public Element issueToken(String tokenType) throws WSTrustException
tokenType
- - The type of token to be issued.WSTrustException
public 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.WSTrustException
public 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.WSTrustException
public 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 security token to be issued.principal
- - The Principal
on behalf of whom the token is to be issued.Element
representing the issued security token.WSTrustException
- if a processing error occurs while issuing the security token.public Element issueToken(RequestSecurityToken request) throws WSTrustException
Issues a security token using the specified RequestSecurityToken
object.
request
- an instance of RequestSecurityToken
that contains the WS-Trust request information.Element
representing the issued security token.IllegalArgumentException
- if the specified request is null.WSTrustException
- if a processing error occurs while issuing the token.public Element renewToken(String tokenType, Element token) throws WSTrustException
tokenType
- - The type of token to be renewed.token
- - The security token to be renewed.WSTrustException
public boolean validateToken(Element token) throws WSTrustException
token
- - The security token to be validated.WSTrustException
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.
token
- the security token to be canceled.true
if the token was successfully canceled; false
otherwise.WSTrustException
- if an error occurs while canceling the security token.public void close()
Copyright © 2018 JBoss by Red Hat. All rights reserved.