Interface SecurityTokenProvider
-
- All Known Implementing Classes:
LibSecurityTokenProvider
public interface SecurityTokenProviderThe classSecurityTokenProvideris a provider interface for managingWSSsecurity tokens.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SecurityAssertiongetSAMLAuthenticationToken(NameIdentifier senderIdentity)Creates a SAML Assertion for message authentication.SecurityAssertiongetSAMLAuthorizationToken(NameIdentifier senderIdentity, SessionContext invocatorSession, EncryptedResourceID encResourceID, boolean includeAuthN, boolean includeResourceAccessStatement, String recipientProviderID)Creates a SAML Assertion for message authorization, the assertion could optionally contain anAuthenticationStatementwhich will be used for message authentication.SecurityAssertiongetSAMLAuthorizationToken(NameIdentifier senderIdentity, SessionContext invocatorSession, String resourceID, boolean includeAuthN, boolean includeResourceAccessStatement, String recipientProviderID)Creates a SAML Assertion for message authorization, the assertion could optionally contain anAuthenticationStatementwhich will be used for message authentication.SecurityAssertiongetSAMLBearerToken(NameIdentifier senderIdentity, SessionContext invocatorSession, EncryptedResourceID encResourceID, boolean includeAuthN, boolean includeResourceAccessStatement, String recipientProviderID)Creates a SAML assertion.SecurityAssertiongetSAMLBearerToken(NameIdentifier senderIdentity, SessionContext invocatorSession, String resourceID, boolean includeAuthN, boolean includeResourceAccessStatement, String recipientProviderID)Creates a SAML assertion.BinarySecurityTokengetX509CertificateToken()Gets theX509certificate Token.voidinitialize(Object credential, XMLSignatureManager sigManager)Initializes theSecurityTokenProvider.voidsetCertAlias(String certAlias)Sets the alias of the certificate used for issuingWSStoken, i.e.voidsetCertificate(X509Certificate cert)Sets the certificate used for issuingWSStoken, i.e.
-
-
-
Method Detail
-
initialize
void initialize(Object credential, XMLSignatureManager sigManager) throws SecurityTokenException
Initializes theSecurityTokenProvider.- Parameters:
credential- The credential of the caller used to see if access to this security token provider is allowed.sigManager- instance of XML digital signature manager class, used for accessing the certificate data store and digital signing of the assertion.- Throws:
SecurityTokenException- if the caller does not have privilege to access the security authority manager.
-
setCertAlias
void setCertAlias(String certAlias) throws SecurityTokenException
Sets the alias of the certificate used for issuingWSStoken, i.e.WSSX509Token,WSSSAML Token. If thecertAliasis never set, a default certificate will be used for issuingWSStokens.- Parameters:
certAlias- String alias name for the certificate- Throws:
SecurityTokenException- if certificate for thecertAliascould not be found in key store.
-
setCertificate
void setCertificate(X509Certificate cert) throws SecurityTokenException
Sets the certificate used for issuingWSStoken, i.e.WSS X509Token,WSSSAML Token. If the certificate is never set, a default certificate will be used for issuingWSStokens.- Parameters:
cert-X509Certificateobject.- Throws:
SecurityTokenException- if the certificate could not be set.
-
getX509CertificateToken
BinarySecurityToken getX509CertificateToken() throws SecurityTokenException
Gets theX509certificate Token.- Returns:
X509certificate Token.- Throws:
SecurityTokenException- if the token could not be obtained.
-
getSAMLAuthenticationToken
SecurityAssertion getSAMLAuthenticationToken(NameIdentifier senderIdentity) throws SecurityTokenException, SAMLException
Creates a SAML Assertion for message authentication.- Parameters:
senderIdentity- name identifier of the sender.- Returns:
- Assertion which contains an
AuthenticationStatement. - Throws:
SecurityTokenException- if the assertion could not be obtained.SAMLException
-
getSAMLAuthorizationToken
SecurityAssertion getSAMLAuthorizationToken(NameIdentifier senderIdentity, SessionContext invocatorSession, String resourceID, boolean includeAuthN, boolean includeResourceAccessStatement, String recipientProviderID) throws SecurityTokenException, SAMLException
Creates a SAML Assertion for message authorization, the assertion could optionally contain anAuthenticationStatementwhich will be used for message authentication.- Parameters:
senderIdentity- name identifier of the sender.invocatorSession-SessionContextof the invocation identity, it is normally obtained by the credential reference in the SAMLAttributeDesignatorfor discovery resource offering which is part of the libertyID-FFAuthenResponse.resourceID- id for the resource to be accessed.includeAuthN- if true, include anAutheticationStatementin the Assertion which will be used for message authentication. if false, noAuthenticationStatementwill be included.includeResourceAccessStatement- if true, aResourceAccessStatementwill be included in the Assertion (forAuthorizeRequesterdirective). If false, aSessionContextStatementwill be included in the Assertion (forAuthenticationSessionContextdirective). In the case when bothAuthorizeRequesterandAuthenticationSessionContextdirective need to be handled, use "true" as parameter here since theSessionContextwill always be included in theResourceAccessStatement.recipientProviderID- recipient's provider ID.- Returns:
SecurityAssertionobject.- Throws:
SecurityTokenException- if the assertion could not be obtainedSAMLException
-
getSAMLAuthorizationToken
SecurityAssertion getSAMLAuthorizationToken(NameIdentifier senderIdentity, SessionContext invocatorSession, EncryptedResourceID encResourceID, boolean includeAuthN, boolean includeResourceAccessStatement, String recipientProviderID) throws SecurityTokenException
Creates a SAML Assertion for message authorization, the assertion could optionally contain anAuthenticationStatementwhich will be used for message authentication.- Parameters:
senderIdentity- name identifier of the sender.invocatorSession-SessionContextof the invocation identity, it is normally obtained by the credential reference in the SAMLAttributeDesignatorfor discovery resource offering which is part of the libertyID-FFAuthenResponse.encResourceID- Encrypted ID for the resource to be accessed.includeAuthN- if true, include anAutheticationStatementin the Assertion which will be used for message authentication. if false, noAuthenticationStatementwill be included.includeResourceAccessStatement- if true, aResourceAccessStatementwill be included in the Assertion (forAuthorizeRequesterdirective). If false, aSessionContextStatementwill be included i the Assertion (forAuthenticationSessionContextdirective). In the case when bothAuthorizeRequesterAuthenticationSessionContext directive need to be handled, use "true" as parameter here since theSessionContextwill always be included in theResourceAccessStatement.recipientProviderID- recipient's provider ID.- Returns:
SecurityAssertionobject.- Throws:
SecurityTokenException- if the assertion could not be obtained
-
getSAMLBearerToken
SecurityAssertion getSAMLBearerToken(NameIdentifier senderIdentity, SessionContext invocatorSession, String resourceID, boolean includeAuthN, boolean includeResourceAccessStatement, String recipientProviderID) throws SecurityTokenException, SAMLException
Creates a SAML assertion. TheconfirmationMethodwill be set tourn:oasis:names:tc:SAML:1.0:cm:bearer.- Parameters:
senderIdentity- name identifier of the sender.invocatorSession-SessionContextof the invocation identity, it is normally obtained by the credential reference in the SAMLAttributeDesignatorfor discovery resource offering which is part of the libertyID-FFAuthenResponse.resourceID- id for the resource to be accessed.includeAuthN- if true, include anAutheticationStatementin the Assertion which will be used for message authentication. if false, noAuthenticationStatementwill be included.includeResourceAccessStatement- if true, aResourceAccessStatementwill be included in the Assertion (forAuthorizeRequesterdirective). If false, aSessionContextStatementwill be included in the Assertion (forAuthenticationSessionContextdirective). In the case when bothAuthorizeRequesterandAuthenticationSessionContextdirective need to be handled, use "true" as parameter here since theSessionContextwill always be included in theResourceAccessStatement.recipientProviderID- recipient's provider ID.- Returns:
SecurityAssertionobject.- Throws:
SecurityTokenException- if the assertion could not be obtainedSAMLException- if the assertion could not be obtained
-
getSAMLBearerToken
SecurityAssertion getSAMLBearerToken(NameIdentifier senderIdentity, SessionContext invocatorSession, EncryptedResourceID encResourceID, boolean includeAuthN, boolean includeResourceAccessStatement, String recipientProviderID) throws SecurityTokenException
Creates a SAML assertion. TheconfirmationMethodwill be set tourn:oasis:names:tc:SAML:1.0:cm:bearer.- Parameters:
senderIdentity- name identifier of the sender.invocatorSession-SessionContextof the invocation identity, it is normally obtained by the credential reference in the SAMLAttributeDesignatorfor discovery resource offering which is part of the libertyID-FFAuthenResponse.encResourceID- Encrypted ID for the resource to be accessed.includeAuthN- if true, include anAutheticationStatementin the Assertion which will be used for message authentication. if false, noAuthenticationStatementwill be included.includeResourceAccessStatement- if true, aResourceAccessStatementwill be included in the Assertion (forAuthorizeRequesterdirective). If false, aSessionContextStatementwill be included in the Assertion (forAuthenticationSessionContextdirective). In the case when bothAuthorizeRequesterandAuthenticationSessionContext/code> directive need to be handled, use "true" as parameter here since theSessionContextwill always be included in theResourceAccessStatement.recipientProviderID- recipient's provider ID.- Returns:
SecurityAssertionobject.- Throws:
SecurityTokenException- if the assertion could not be obtained
-
-