|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.pingidentity.sts.clientapi.STSClient
public class STSClient
STSClient provides operations to invoke STS functions.
Constructor Summary | |
---|---|
STSClient(java.lang.String endpoint)
Creates STSClient. |
|
STSClient(STSClientConfiguration stsClientConfiguration)
Creates STSClient using appropriate configuration. |
Method Summary | |
---|---|
RequestSecurityTokenData |
createIssueData()
Creates request data for an Issue RST request. |
RequestSecurityTokenData |
createValidateData()
Creates request data for a Validate RST request. |
SamlToken |
extractTokenFromSecurityHeader(org.w3c.dom.Element securityHeader)
Extracts a SAML Assertion from a Security Header. |
STSClientConfiguration |
getStsClientConfiguration()
|
org.w3c.dom.Element |
issueToken(java.lang.String tokenData)
Sends an RST request to the STS server. |
org.w3c.dom.Element |
issueToken(java.lang.String username,
java.lang.String password)
Sends an RST request to the STS server. |
org.w3c.dom.Element |
issueToken(Token token)
Sends an RST request to the STS server. |
org.w3c.dom.Element |
issueToken(javax.security.auth.x500.X500PrivateCredential credential)
Sends an RST request to the STS server. |
STSResponse |
makeRequest(RequestSecurityTokenData rstData,
org.w3c.dom.Element token,
java.lang.Object requestorCredentials,
java.lang.String tokenType)
|
STSResponse |
makeRequest(RequestSecurityTokenData rstData,
org.w3c.dom.Element token,
java.lang.Object requestorCredentials,
java.lang.String tokenType,
boolean embeddedToken)
Sends the RST request to the STS server. |
STSResponse |
makeRequest(RequestSecurityTokenData rstData,
org.w3c.dom.Element token,
java.lang.Object requestorCredentials,
java.lang.String tokenType,
javax.security.auth.x500.X500PrivateCredential credential)
Sends the RST request to the STS server. |
STSResponse |
makeRequest(RequestSecurityTokenData rstData,
org.w3c.dom.Element token,
java.lang.Object requestorCredentials,
java.lang.String tokenType,
javax.security.auth.x500.X500PrivateCredential credential,
boolean useEmbeddedToken)
Sends the RST request to the STS server. |
void |
registerSecurityTokenReference(javax.xml.namespace.QName tokenElementName,
java.lang.String tokenType,
SecurityTokenReference securityTokenReference)
Registers the SecurityTokenReference object for a token of tokenElementName . |
void |
setStsCertificate(java.security.cert.X509Certificate certificate)
Sets the STS Server Certificate if you want to check the server signature of the RSTRs. |
boolean |
validateToken(SamlToken token)
Validates a given token on the PingFederate server. |
org.w3c.dom.Element |
wrapTokenInSecurityHeader(org.w3c.dom.Element token)
Wraps a token in Security Header. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public STSClient(java.lang.String endpoint) throws java.net.MalformedURLException
endpoint
- the Security Token Service endpoint
java.net.MalformedURLException
- if the endpoint URL is malformed.public STSClient(STSClientConfiguration stsClientConfiguration) throws java.net.MalformedURLException
stsClientConfiguration
- the configuration
java.net.MalformedURLException
- if the STS endpoint URL in the configuration is malformedMethod Detail |
---|
public STSClientConfiguration getStsClientConfiguration()
public void setStsCertificate(java.security.cert.X509Certificate certificate)
certificate
- the STS Server Certificatepublic STSResponse makeRequest(RequestSecurityTokenData rstData, org.w3c.dom.Element token, java.lang.Object requestorCredentials, java.lang.String tokenType, javax.security.auth.x500.X500PrivateCredential credential, boolean useEmbeddedToken) throws STSClientException, java.io.IOException
rstData
- contains RST data.token
- the token to be validated.requestorCredentials
- credentials of the requestor. Acceptable credential type are
HTTPAuthentication
and
WSSEAuthentication
.tokenType
- the token type that is needed for referencing of the token. If null STSClient tries to find
the most appropritate token type for the token element being provided.credential
- if provided the message will be signed with that credential.useEmbeddedToken
- indicates whether to reference token from RST (false), or embed it to RST (true
).
- Returns:
- the Response from the STS server
- Throws:
STSClientException
- if the request can't be generated
java.io.IOException
- if an IO exception occurs- See Also:
RequestSecurityTokenData
public STSResponse makeRequest(RequestSecurityTokenData rstData, org.w3c.dom.Element token, java.lang.Object requestorCredentials, java.lang.String tokenType, javax.security.auth.x500.X500PrivateCredential credential) throws STSClientException, java.io.IOException
rstData
- contains RST data.token
- the token to be validated.requestorCredentials
- credentials of the requestor. Acceptable credential type are
HTTPAuthentication
and
WSSEAuthentication
.tokenType
- the token type that is needed for referencing of the token. If null STSClient tries to find
the most appropritate token type for the token element being provided.credential
- if provided the message will be signed with that credential.
STSClientException
- if the request can't be generated
java.io.IOException
- if an IO exception occursRequestSecurityTokenData
public STSResponse makeRequest(RequestSecurityTokenData rstData, org.w3c.dom.Element token, java.lang.Object requestorCredentials, java.lang.String tokenType, boolean embeddedToken) throws STSClientException, java.io.IOException
makeRequest(com.pingidentity.sts.clientapi.model.RequestSecurityTokenData, org.w3c.dom.Element, Object, String, javax.security.auth.x500.X500PrivateCredential)
does with credential = null
.
rstData
- contains RST data.token
- the token to be validated.requestorCredentials
- credentials of the requestor. Acceptable credential type are
HTTPAuthentication
and
WSSEAuthentication
.tokenType
- the token type that is needed for referencing of the token. If null STSClient tries to find
the most appropritate token type for the token element being provided.embeddedToken
-
STSClientException
- if the request can't be generated
java.io.IOException
- if an IO exception occursRequestSecurityTokenData
public STSResponse makeRequest(RequestSecurityTokenData rstData, org.w3c.dom.Element token, java.lang.Object requestorCredentials, java.lang.String tokenType) throws STSClientException, java.io.IOException
STSClientException
java.io.IOException
public org.w3c.dom.Element wrapTokenInSecurityHeader(org.w3c.dom.Element token)
token
- the token
public SamlToken extractTokenFromSecurityHeader(org.w3c.dom.Element securityHeader) throws SecurityTokenException
securityHeader
- the Security Header, which be retrieved via javax.xml.soap.SOAPMessage.getSOAPHeader()
SecurityTokenException
- if there's a problem with parsing the SAML Assertionpublic boolean validateToken(SamlToken token) throws STSClientException
STSClientConfiguration
.
token
- the token to be validated.
STSClientException
- in case of exceptions during token validationpublic org.w3c.dom.Element issueToken(Token token) throws STSClientException
STSClientException
- to indicate failed requestpublic org.w3c.dom.Element issueToken(java.lang.String tokenData) throws STSClientException
tokenData
- base64 encoded binary data that is used to construct a binary token. This token is sent
to the STS server along with the RST.
STSClientException
- to indicate failed requestpublic org.w3c.dom.Element issueToken(javax.security.auth.x500.X500PrivateCredential credential) throws STSClientException
credential
- the X509 certificate keypair
STSClientException
- to indicate failed requestpublic org.w3c.dom.Element issueToken(java.lang.String username, java.lang.String password) throws STSClientException
username
- the user namepassword
- the user password
STSClientException
- to indicate failed requestpublic void registerSecurityTokenReference(javax.xml.namespace.QName tokenElementName, java.lang.String tokenType, SecurityTokenReference securityTokenReference)
SecurityTokenReference
object for a token of tokenElementName
.
tokenElementName
- token element namesecurityTokenReference
- SecurityTokenReference objecttokenType
- the token type, may be null if the token type can be unambiguously obtained from the token
elementSecurityTokenReference
public RequestSecurityTokenData createIssueData()
public RequestSecurityTokenData createValidateData()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |