public abstract class ProviderConfig extends Object
ProviderConfig
represents the Web Services
Server provider or the Web Services Client provider configuration.
Pluggable implementation of this abstract class can choose to store this configuration in desired configuration store. This pluggable implementation class can be configured in client's AMConfig.properties as value of "com.sun.identity.wss.provider.config.plugin" property. Having obtained an instance of ProviderConfig, its methods can be called to create, delete, modify, retrieve WSS agent profile and configuration for WSC and/or WSP attributes (key /value pairs).
All the static methods in this class are for the persistent operations.
Constructor and Description |
---|
ProviderConfig() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
delete()
Deletes the provider configuration.
|
static void |
deleteProvider(String providerName,
String providerType)
Removes the provider configuration.
|
boolean |
forceUserAuthentication()
Returns true if the user force authentication is enabled.
|
static List |
getAllMessageLevelSecurityMech()
Returns the list of message level security mechanism objects.
|
static List |
getAllSupportedSecurityMech()
Returns the list of all available security mechanism objects.
|
String |
getAuthenticationChain()
Returns the authentication chain mechanism to be used.
|
String |
getDNSClaim()
Returns the DNS claim name.
|
String |
getEncryptionAlgorithm()
Returns the encryption algorithm
|
int |
getEncryptionStrength()
Returns the encryption data strength.
|
String |
getKDCDomain()
Returns Kerberos Domain Controller Domain
|
String |
getKDCServer()
Returns Kerberos Domain Controller Server.
|
String |
getKerberosServicePrincipal()
Returns kerberos service principal
|
String |
getKerberosTicketCacheDir()
This method is used by the web services client to get the kerberos
ticket cache directory.
|
String |
getKeyAlias()
Returns the key alias for this provider.
|
String |
getKeyEncryptedPassword()
Returns the keystore encrypted password.
|
String |
getKeyPassword()
Returns the key password in the keystore.
|
KeyStore |
getKeyStore()
Returns the provider JKS
KeyStore |
String |
getKeyStoreEncryptedPasswd()
Returns the keystore encrypted password.
|
String |
getKeyStoreFile()
Returns the keystore file.
|
String |
getKeyStorePassword()
Returns the keystore password.
|
String |
getKeyTabFile()
This method is used by the web services provider to get the key tab file.
|
String |
getKeyType()
Returns the key type for this provider.
|
String |
getNameIDMapper()
Returns the NameID mapper class
|
String |
getProperty(String property)
Returns the value of the property.
|
static ProviderConfig |
getProvider(String providerName,
String providerType)
Returns the provider configuration for a given provider name.
|
static ProviderConfig |
getProvider(String providerName,
String providerType,
boolean initialize)
Returns the provider configuration for a given provider name.
|
static ProviderConfig |
getProviderByEndpoint(String endpoint,
String providerType)
Returns the provider configuration for a given end point
|
String |
getProviderName()
Returns the name of the Provider.
|
String |
getProviderType()
Returns the provider type.
|
String |
getPublicKeyAlias()
Returns the Public key alias for this provider's partner.
|
Set |
getSAMLAttributeMapping()
Returns the SAML Attribute Mapping list.
|
String |
getSAMLAttributeNamespace()
Returns SAML attribute namespace.
|
List |
getSecurityMechanisms()
Returns the list of security mechanims that the provider is configured.
|
String |
getServiceType()
Returns the service type.
|
List |
getSignedElements()
Returns the list of signed elements.
|
String |
getSigningRefType()
Returns signing reference type.
|
String |
getTokenConversionType()
Returns the type of the token that needs to be converted to.
|
TrustAuthorityConfig |
getTrustAuthorityConfig()
Returns the provider's trusted authorities list.
|
List |
getUsers()
Returns the list of
PasswordCredential s of the user. |
String |
getWSPEndpoint()
Returns the endpoint of the web services provider.
|
String |
getWSSProxyEndpoint()
Returns the endpoint of the web services security proxy.
|
protected abstract void |
init(String providerName,
String providerType,
SSOToken token,
boolean isEndPoint)
Initializes the provider.
|
protected abstract boolean |
isExists()
Checks if the provider configuration exists.
|
boolean |
isMessageReplayDetectionEnabled()
Returns true if the message replay detection is enabled.
|
static boolean |
isProviderExists(String providerName,
String providerType)
Checks if the provider of given type does exists.
|
static boolean |
isProviderExists(String providerName,
String providerType,
boolean isEndPoint)
Checks if the provider of given type does exists.
|
boolean |
isRequestEncryptEnabled()
Checks if the request needs to be encrypted or not.
|
boolean |
isRequestHeaderEncryptEnabled()
Checks if the request header needs to be encrypted or not.
|
boolean |
isRequestSignEnabled()
Checks if the request needs to be signed or not.
|
boolean |
isResponseEncryptEnabled()
Checks if the response needs to be encrypted or not.
|
boolean |
isResponseSignEnabled()
Checks if the response needs to be signed or not.
|
boolean |
isUserTokenDetectReplayEnabled()
Returns true if the user name token replay is enabled.
|
boolean |
isValidateKerberosSignature()
Returns true if kerberos signature needs to be validated.
|
boolean |
preserveSecurityHeader()
Returns true if security header needs to be preserved.
|
static void |
saveProvider(ProviderConfig config)
Saves the Provider in the configuration repository.
|
void |
setAdminToken(SSOToken adminToken)
Sets the admin token.
|
void |
setAuthenticationChain(String authenticationChain)
Sets the authentication chain mechanism.
|
void |
setDefaultKeyStore(boolean set)
Sets the provider to use the default keystore.
|
void |
setDetectUserTokenReplay(boolean enable)
Enable or disable the detection of user token replay
|
void |
setDNSClaim(String dnsClaim)
Sets the DNS claim name
|
void |
setEncryptionAlgorithm(String encAlg)
Sets the encryption algorithm.
|
void |
setEncryptionStrength(int keyStrength)
Sets the encryption data strength
|
void |
setForceUserAuthentication(boolean forceAuthn)
Sets the user force authentication attribute.
|
void |
setIncludeMemberships(boolean include)
Sets a flag to include memberships for SAML attribute mapping.
|
void |
setKDCDomain(String domain)
Sets Kerberos Domain Controller Domain
|
void |
setKDCServer(String kdcServer)
Sets Kerberos Domain Controller Server
|
void |
setKerberosServicePrincipal(String principal)
Sets kerberos service principal.
|
void |
setKerberosTicketCacheDir(String cacheDir)
Sets kerberos ticket cache dir.
|
void |
setKeyAlias(String alias)
Sets the key alias for this provider.
|
void |
setKeyStore(KeyStore keyStore,
String password)
Sets the keystore for this provider.
|
void |
setKeyStore(String fileName,
String keyStorePassword,
String keyPassword)
Sets the keystore for this provider.
|
void |
setKeyTabFile(String file)
Sets the keytab file
|
void |
setKeyType(String keyType)
Sets the key type for this provider.
|
void |
setMessageReplayDetection(boolean enable)
Enable or disable the message replay detection.
|
void |
setNameIDMapper(String nameIDMapper)
Sets the NameID Mapper class.
|
void |
setPassThroughSecurityToken(boolean usepassthrough)
Sets if passthrough security token needs to be used
This is valid for a proxy web services client.
|
void |
setPreserveSecurityHeader(boolean preserve)
Sets if security header needs to be preserved.
|
void |
setProperty(String property,
String value)
Sets the value for the given property in Provider Configuration.
|
void |
setPublicKeyAlias(String alias)
Sets the Public key alias for this provider's partner.
|
void |
setRequestEncryptEnabled(boolean enable)
Sets the request encrypt enable flag.
|
void |
setRequestHeaderEncryptEnabled(boolean enable)
Sets the request header encrypt enable flag.
|
void |
setRequestSignEnabled(boolean enable)
Sets the request sign enable flag.
|
void |
setResponseEncryptEnabled(boolean enable)
Sets the response encrypt enable flag.
|
void |
setResponseSignEnabled(boolean enable)
Sets the response sign enable flag.
|
void |
setSAMLAttributeMapping(Set attributeMap)
Sets the list of SAML attribute mappings.
|
void |
setSAMLAttributeNamespace(String attributeNS)
Sets SAML attribute namespace.
|
void |
setSecurityMechanisms(List authMech)
Sets the list of security mechanisms.
|
void |
setServiceType(String serviceType)
Sets the service type.
|
void |
setSignedElements(List signedElements)
Sets the signed elements
|
void |
setSigningRefType(String refType)
Sets the signing reference type.
|
void |
setTokenConversionType(String tokenType)
Sets the type of the token that needs to be converted to.
|
void |
setTrustAuthorityConfig(TrustAuthorityConfig taconfig)
Sets the trusted authority configurations.
|
void |
setUsers(List usercredentials)
Sets the user credentials list.
|
void |
setValidateKerberosSignature(boolean validate)
Sets a boolean flag to enable or disable validate kerberos signature.
|
void |
setWSPEndpoint(String endpoint)
Sets the web services provider endpoint.
|
void |
setWSSProxyEndpoint(String endpoint)
Sets the web services security proxy endpoint.
|
boolean |
shouldIncludeMemberships()
Checks if the memberships should be included in the SAML attribute
mapping.
|
protected abstract void |
store()
Stores the provider configuration.
|
boolean |
useDefaultKeyStore()
Returns true if the provider uses default keystore.
|
boolean |
usePassThroughSecurityToken()
Returns true if passthrough security token needs to be used.
|
public static final String WSC
public static final String WSP
public static final String WSS_PROVIDER_CONFIG_PLUGIN
protected List secMech
protected String serviceURI
protected String providerName
protected String wspEndpoint
protected String wssProxyEndpoint
protected String providerType
protected KeyStore keyStore
protected String privateKeyAlias
protected String privateKeyType
protected String publicKeyAlias
protected boolean isResponseSigned
protected boolean isResponseEncrypted
protected boolean isRequestSigned
protected boolean isRequestEncrypted
protected boolean isRequestHeaderEncrypted
protected List trustAuthorities
protected String ksPasswd
protected String keyPasswd
protected String ksFile
protected Properties properties
protected List usercredentials
protected String serviceType
protected boolean isDefaultKeyStore
protected boolean forceAuthn
protected boolean preserveSecHeaders
protected String authenticationChain
protected TrustAuthorityConfig taconfig
protected Set samlAttributes
protected boolean includeMemberships
protected String nameIDMapper
protected String attributeNS
protected String kdcDomain
protected String kdcServer
protected String ticketCacheDir
protected String servicePrincipal
protected String keytabFile
protected boolean verifyKrbSignature
protected boolean usePassThroughToken
protected String tokenConversionType
protected String encryptionAlgorithm
protected int encryptionStrength
protected String signingRefType
protected static SSOToken customAdminToken
protected boolean detectUserTokenReplay
protected boolean detectMessageReplay
protected String dnsClaim
protected List signedElements
public List getSecurityMechanisms()
public void setSecurityMechanisms(List authMech)
authMech
- the list of security mechanisms.public String getProviderName()
public String getProperty(String property)
property
- the name of property for which value is being retrieved.public void setProperty(String property, String value)
property
- the name of the property being set.value
- the property value being set.public String getWSPEndpoint()
public void setWSPEndpoint(String endpoint)
endpoint
- the web services provider endpoint.public String getWSSProxyEndpoint()
public void setWSSProxyEndpoint(String endpoint)
endpoint
- the web services security proxy endpoint.public void setServiceType(String serviceType)
serviceType
- the service type.public String getServiceType()
public void setUsers(List usercredentials)
usercredentials
- list of PasswordCredential
objects.public List getUsers()
PasswordCredential
s of the user.PasswordCredential
objects.public boolean isUserTokenDetectReplayEnabled()
public void setDetectUserTokenReplay(boolean enable)
enable
- true if the detection of user token replay is enabled.public boolean isMessageReplayDetectionEnabled()
public void setMessageReplayDetection(boolean enable)
enable
- true if the detection of the message replay is enabled.public String getProviderType()
public KeyStore getKeyStore()
KeyStore
KeyStore
public String getKeyStoreFile()
public String getKeyStorePassword()
public String getKeyStoreEncryptedPasswd()
public String getKeyPassword()
public String getKeyEncryptedPassword()
public void setKeyStore(String fileName, String keyStorePassword, String keyPassword) throws ProviderException
fileName
- the provider key store fully qualified file name.keyStorePassword
- the password required to access the key
store file.keyPassword
- the password required to access the key from the
keystore.ProviderException
- if the key store file does not exist
or an invalid password.public void setKeyStore(KeyStore keyStore, String password)
keyStore
- the provider key store.password
- the password required to access the key store file.public String getKeyType()
public void setKeyType(String keyType)
keyType
- the key type for this provider.public String getKeyAlias()
public void setKeyAlias(String alias)
alias
- the key alias for this provider.public String getPublicKeyAlias()
public void setPublicKeyAlias(String alias)
alias
- the Public key alias for this provider's partner.public boolean useDefaultKeyStore()
public void setDefaultKeyStore(boolean set)
set
- boolean variable to enable or disable to use the default
keystore.public Set getSAMLAttributeMapping()
public void setSAMLAttributeMapping(Set attributeMap)
attributeMap
- the list of SAML attribute mappingpublic boolean shouldIncludeMemberships()
public void setIncludeMemberships(boolean include)
include
- boolean flag to indicate if the memberships needs to
be included.public String getNameIDMapper()
public void setNameIDMapper(String nameIDMapper)
nameIDMapper
- NameID Mapper class.public String getSAMLAttributeNamespace()
public void setSAMLAttributeNamespace(String attributeNS)
attributeNS
- SAML attribute namespace.public String getKDCDomain()
public void setKDCDomain(String domain)
domain
- Kerberos Domain Controller Domainpublic String getKDCServer()
public void setKDCServer(String kdcServer)
kdcServer
- Kerberos Domain Controller Serverpublic String getKerberosTicketCacheDir()
public void setKerberosTicketCacheDir(String cacheDir)
cacheDir
- kerberos ticket cache dirpublic String getKeyTabFile()
public void setKeyTabFile(String file)
file
- the fully qualified file pathpublic String getKerberosServicePrincipal()
public void setKerberosServicePrincipal(String principal)
principal
- the kerberos service principal.public boolean isValidateKerberosSignature()
public void setValidateKerberosSignature(boolean validate)
validate
- boolean flag to enable or disable validate krb signature.public String getDNSClaim()
public void setDNSClaim(String dnsClaim)
dnsClaim
- the DNS claim namepublic List getSignedElements()
public void setSignedElements(List signedElements)
signedElements
- the signed elements.public TrustAuthorityConfig getTrustAuthorityConfig()
TrustAuthorityConfig
s.public void setTrustAuthorityConfig(TrustAuthorityConfig taconfig)
taconfig
- instance of the TrustAuthorityConfig
.public boolean isResponseSignEnabled()
public void setResponseSignEnabled(boolean enable)
enable
- enables the response signing.public boolean isResponseEncryptEnabled()
public void setResponseEncryptEnabled(boolean enable)
enable
- enables the response encryption.public boolean isRequestSignEnabled()
public void setRequestSignEnabled(boolean enable)
enable
- enables the request signing.public boolean isRequestEncryptEnabled()
public void setRequestEncryptEnabled(boolean enable)
enable
- enables the request encryption.public boolean isRequestHeaderEncryptEnabled()
public void setRequestHeaderEncryptEnabled(boolean enable)
enable
- enables the request header encryption.public boolean forceUserAuthentication()
public void setForceUserAuthentication(boolean forceAuthn)
forceAuthn
- the user force authentication attribute.public boolean preserveSecurityHeader()
public void setPreserveSecurityHeader(boolean preserve)
preserve
- value to be set, true if the security header needs
to be preserved, false otherwise.public String getAuthenticationChain()
public void setAuthenticationChain(String authenticationChain)
authenticationChain
- the name of the authentication chain
mechanism.public boolean usePassThroughSecurityToken()
public void setPassThroughSecurityToken(boolean usepassthrough)
usepassthrough
- flag to if the wsc needs to use passthrough
security token.public String getTokenConversionType()
public void setTokenConversionType(String tokenType)
tokenType
- the type of the token that needs to be converted to.public String getSigningRefType()
public void setSigningRefType(String refType)
refType
- the signing reference type.public String getEncryptionAlgorithm()
public void setEncryptionAlgorithm(String encAlg)
encAlg
- the encryption algorithm.public int getEncryptionStrength()
public void setEncryptionStrength(int keyStrength)
keyStrength
- the encryption data strength.protected abstract void store() throws ProviderException
ProviderException
- if there is any failure.protected abstract void delete() throws ProviderException
ProviderException
- if there is any failure.protected abstract boolean isExists()
protected abstract void init(String providerName, String providerType, SSOToken token, boolean isEndPoint) throws ProviderException
providerName
- the provider name.providerType
- the provider type.token
- Single Sign-on token.isEndPoint
- Boolean flag indicating whether provider needs to be
searched based on its end point value.ProviderException
- if there is any failure.public static void saveProvider(ProviderConfig config) throws ProviderException
config
- the provider configuration.ProviderException
- if the creation is failed.public static ProviderConfig getProvider(String providerName, String providerType) throws ProviderException
providerName
- the provider name.providerType
- the provider type.ProviderException
- if unable to retrieve.public static ProviderConfig getProvider(String providerName, String providerType, boolean initialize) throws ProviderException
providerName
- the provider name.providerType
- the provider type.initialize
- if set to false the provider configuration will not
be retrieved from the persistent store and returns just the
memory image of the provider configuration. Also if set to
false the provider configuration can not be saved persistently
using store()
.ProviderException
- if unable to retrieve.public static ProviderConfig getProviderByEndpoint(String endpoint, String providerType) throws ProviderException
endpoint
- the end point is the search string to retrieve the
provider configuration.providerType
- the provider type.ProviderException
- if unable to retrieve.public static boolean isProviderExists(String providerName, String providerType)
providerName
- the name of the provider.providerType
- type of the provider.public static boolean isProviderExists(String providerName, String providerType, boolean isEndPoint)
providerName
- the name of the provider.providerType
- type of the provider.isEndPoint
- flag to indicate check/search based on WSP end point.public static void deleteProvider(String providerName, String providerType) throws ProviderException
providerName
- the name of the provider.providerType
- the type of the provider.ProviderException
- if any failure.public static List getAllSupportedSecurityMech()
SecurityMechanism
objects.public static List getAllMessageLevelSecurityMech()
SecurityMechanism
objects.public void setAdminToken(SSOToken adminToken)
ProviderConfig
object.
This admin token needs to be the valid SSOToken of the user who has
"Agent Administrator" privileges.adminToken
- the agent admin token.Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.