public class LocalSTSClient
extends java.lang.Object
importClass(Packages.com.tivoli.am.fim.fedmgr2.trust.util.LocalSTSClient);
importClass(Packages.com.tivoli.am.fim.trustserver.sts.utilities.IDMappingExtUtils);
// Parse a base token. In this case a BinarySecurityToken containing a JWT.
var base_token = IDMappingExtUtils.stringToXMLElement("eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjM0NTY3ODkwIn0.Dt2W1GtOLnnqf4-PUr5Ns_9BuLLmwpWO5zBwN4fokX4 ");
// Validate the token using the chain with isser and appliesTo value of 'jwt:validate', do not pass any claims.
var res = LocalSTSClient.doRequest("http://schemas.xmlsoap.org/ws/2005/02/trust/Validate", "jwt:validate","jwt:validate", base_token, null)
if (res.errorMessage == null) {
var result_element_string = IDMappingExtUtils.xmlElementToString(res.token);
IDMappingExtUtils.traceString("got result: " + result_element_string);
// Do something with the result.
} else {
IDMappingExtUtils.throwSTSException("An error occurred invoking the STS: " + res.errorMessage);
}
| Modifier and Type | Class and Description |
|---|---|
static class |
LocalSTSClient.LocalSTSClientResult
A simple result container.
|
| Constructor and Description |
|---|
LocalSTSClient() |
| Modifier and Type | Method and Description |
|---|---|
static LocalSTSClient.LocalSTSClientResult |
doRequest(java.lang.String requestType,
java.lang.String tokenType,
org.w3c.dom.Element base,
org.w3c.dom.Element claims)
Invoke the STS locally using a token-type for chain determination.
|
static LocalSTSClient.LocalSTSClientResult |
doRequest(java.lang.String requestType,
java.lang.String appliesTo,
java.lang.String issuer,
org.w3c.dom.Element base,
org.w3c.dom.Element claims)
Invoke the STS locally using a appliesTo and issuer for chain
determination.
|
public static LocalSTSClient.LocalSTSClientResult doRequest(java.lang.String requestType, java.lang.String appliesTo, java.lang.String issuer, org.w3c.dom.Element base, org.w3c.dom.Element claims)
requestType - WS-trust request type to use.appliesTo - used for chain determination.issuer - used fo chain determination.base - token to present.claims - to include in the request.public static LocalSTSClient.LocalSTSClientResult doRequest(java.lang.String requestType, java.lang.String tokenType, org.w3c.dom.Element base, org.w3c.dom.Element claims)
requestType - WS-trust request type to use.tokenType - used for chain determination.base - token to present.claims - to include in the request.