public abstract class AbstractStsRealm extends org.apache.shiro.realm.AuthenticatingRealm implements STSClientConfiguration
| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractStsRealm.STSCredentialsMatcher
Credentials matcher class that ensures the AuthInfo received from the STS matches the AuthToken
|
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.cxf.Bus |
bus |
| Constructor and Description |
|---|
AbstractStsRealm() |
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.cxf.ws.security.trust.STSClient |
configureStsClient()
Helper method to setup STS Client.
|
protected Element |
createClaimsElement()
Create the claims element with the claims provided in the STS client configuration in the admin
console.
|
protected org.apache.shiro.authc.AuthenticationInfo |
doGetAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken token)
Perform authentication based on the supplied token.
|
String |
getAddress()
Retrieves the address of the STS server.
|
String |
getAssertionType()
Retrieves the assertion type that should be requested from the STS.
|
protected org.apache.cxf.Bus |
getBus()
Helper method to setup STS Client.
|
List<String> |
getClaims()
Retrieves the list of claims that should be requested from the STS.
|
ContextPolicyManager |
getContextPolicyManager() |
String |
getEncryptionProperties()
Per WS-Security Policy:
|
String |
getEncryptionUsername()
Per WS-Security Policy:
|
String |
getEndpointName()
Retrieves the endpoint name of the STS service.
|
String |
getKeySize()
Retrieves the size of the key that should be used.
|
String |
getKeyType()
Retrieves the key type that should be used when communicating with the STS.
|
String |
getPassword()
Retrieves the password for the associated username set in
#setUsername() |
String |
getServiceName()
Retrieves the service name of the STS service.
|
String |
getSignatureProperties()
Per WS-Security Policy:
|
String |
getSignatureUsername()
Per WS-Security Policy:
|
String |
getTokenProperties()
Per WS-Security Policy:
|
String |
getTokenUsername()
Per WS-Security Policy:
|
Boolean |
getUseKey()
Flags whether or not to supply a key in the request.
|
String |
getUsername()
Retrieves the user's name for performing operations on the STS.
|
protected org.apache.cxf.ws.security.tokenstore.SecurityToken |
renewSecurityToken(org.apache.cxf.ws.security.tokenstore.SecurityToken securityToken)
Renew a security token (SAML assertion) from the STS.
|
protected org.apache.cxf.ws.security.tokenstore.SecurityToken |
requestSecurityToken(Object authToken)
Request a security token (SAML assertion) from the STS.
|
void |
setAddress(String address)
Sets the address of the STS server.
|
void |
setAssertionType(String assertionType)
Sets the assertion type that should be requested from the STS.
|
void |
setClaims(List<String> claims)
Sets the claim list with the incoming list.
|
void |
setClaims(String claimsListAsString)
Sets the claim list with the incoming comma-delimieted string of URI values.
|
void |
setContextPolicyManager(ContextPolicyManager contextPolicyManager) |
void |
setEncryptionProperties(String encryptionProperties)
Sets the location of the encryption properties file.
|
void |
setEncryptionUsername(String encryptionUsername)
Sets the user's name for encryption.
|
void |
setEndpointName(String endpointName)
Sets the endpoint name of the STS service.
|
void |
setKeySize(String keySize)
Sets the size of the key that should be used.
|
void |
setKeyType(String keyType)
Sets the key type that should be used when communicating with the STS.
|
void |
setPassword(String password)
Sets the password for the current user.
|
void |
setServiceName(String serviceName)
Sets the service name of the STS service.
|
void |
setSignatureProperties(String signatureProperties)
Sets the location of the signature properties file.
|
void |
setSignatureUsername(String signatureUsername)
Sets the user's signature name.
|
void |
setTokenProperties(String tokenProperties)
Sets the location of the token properties file.
|
void |
setTokenUsername(String tokenUsername)
Sets the alias name for the user's public key.
|
void |
setUseKey(Boolean useKey)
Sets whether or not to supply a key in the request.
|
void |
setUsername(String username)
Sets the user's name to use for performing STS operations.
|
protected abstract boolean |
shouldHandleWss() |
boolean |
supports(org.apache.shiro.authc.AuthenticationToken token)
Determine if the supplied token is supported by this realm.
|
afterCacheManagerSet, assertCredentialsMatch, clearCachedAuthenticationInfo, doClearCache, getAuthenticationCache, getAuthenticationCacheKey, getAuthenticationCacheKey, getAuthenticationCacheName, getAuthenticationInfo, getAuthenticationTokenClass, getCredentialsMatcher, init, isAuthenticationCachingEnabled, isAuthenticationCachingEnabled, onInit, setAuthenticationCache, setAuthenticationCacheName, setAuthenticationCachingEnabled, setAuthenticationTokenClass, setCredentialsMatcher, setNamepublic ContextPolicyManager getContextPolicyManager()
public void setContextPolicyManager(ContextPolicyManager contextPolicyManager)
public boolean supports(org.apache.shiro.authc.AuthenticationToken token)
supports in interface org.apache.shiro.realm.Realmsupports in class org.apache.shiro.realm.AuthenticatingRealmprotected abstract boolean shouldHandleWss()
protected org.apache.shiro.authc.AuthenticationInfo doGetAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken token)
doGetAuthenticationInfo in class org.apache.shiro.realm.AuthenticatingRealmprotected org.apache.cxf.ws.security.tokenstore.SecurityToken requestSecurityToken(Object authToken)
authToken - The subject the security token is being request for.protected org.apache.cxf.ws.security.tokenstore.SecurityToken renewSecurityToken(org.apache.cxf.ws.security.tokenstore.SecurityToken securityToken)
securityToken - The token being renewed.protected org.apache.cxf.Bus getBus()
protected org.apache.cxf.ws.security.trust.STSClient configureStsClient()
protected Element createClaimsElement()
public String getAddress()
STSClientConfigurationgetAddress in interface STSClientConfigurationpublic void setAddress(String address)
STSClientConfigurationsetAddress in interface STSClientConfigurationaddress - String-based URL of the STS endpoint with no "WSDL" on the end.public String getEndpointName()
STSClientConfigurationDefault is {http://docs.oasis-open.org/ws-sx/ws-trust/200512/}STS_Port
getEndpointName in interface STSClientConfigurationpublic void setEndpointName(String endpointName)
STSClientConfigurationsetEndpointName in interface STSClientConfigurationendpointName - String-based endpoint name.public String getServiceName()
STSClientConfigurationDefault is {http://docs.oasis-open.org/ws-sx/ws-trust/200512/} SecurityTokenService
getServiceName in interface STSClientConfigurationpublic void setServiceName(String serviceName)
STSClientConfigurationsetServiceName in interface STSClientConfigurationserviceName - String-based service namepublic String getUsername()
STSClientConfigurationgetUsername in interface STSClientConfigurationpublic void setUsername(String username)
STSClientConfigurationsetUsername in interface STSClientConfigurationpublic String getPassword()
STSClientConfiguration#setUsername()getPassword in interface STSClientConfigurationpublic void setPassword(String password)
STSClientConfigurationsetPassword in interface STSClientConfigurationpublic String getSignatureUsername()
STSClientConfigurationThe user's name for signature. It is used as the alias name in the keystore to get the user's cert and private key for signature.
getSignatureUsername in interface STSClientConfigurationpublic void setSignatureUsername(String signatureUsername)
STSClientConfigurationsetSignatureUsername in interface STSClientConfigurationpublic String getSignatureProperties()
STSClientConfigurationLocation of the crypto property configuration to use for signature.
getSignatureProperties in interface STSClientConfigurationpublic void setSignatureProperties(String signatureProperties)
STSClientConfigurationsetSignatureProperties in interface STSClientConfigurationpublic String getEncryptionUsername()
STSClientConfigurationThe user's name for encryption. It is used as the alias name in the keystore to get the user's public key for encryption.
getEncryptionUsername in interface STSClientConfigurationpublic void setEncryptionUsername(String encryptionUsername)
STSClientConfigurationsetEncryptionUsername in interface STSClientConfigurationpublic String getEncryptionProperties()
STSClientConfigurationLocation of the crypto property configuration to use for encryption.
getEncryptionProperties in interface STSClientConfigurationpublic void setEncryptionProperties(String encryptionProperties)
STSClientConfigurationsetEncryptionProperties in interface STSClientConfigurationpublic String getTokenUsername()
STSClientConfigurationThe alias name in the keystore to get the user's public key to send to the STS for the PublicKey KeyType case.
getTokenUsername in interface STSClientConfigurationpublic void setTokenUsername(String tokenUsername)
STSClientConfigurationsetTokenUsername in interface STSClientConfigurationpublic String getTokenProperties()
STSClientConfigurationLocation of the crypto property configuration used by the STSClient to send/process any RSA/DSAKeyValue tokens used if the KeyType is "PublicKey".
getTokenProperties in interface STSClientConfigurationpublic void setTokenProperties(String tokenProperties)
STSClientConfigurationsetTokenProperties in interface STSClientConfigurationpublic List<String> getClaims()
STSClientConfigurationgetClaims in interface STSClientConfigurationpublic void setClaims(List<String> claims)
STSClientConfigurationsetClaims in interface STSClientConfigurationpublic void setClaims(String claimsListAsString)
STSClientConfigurationsetClaims in interface STSClientConfigurationpublic String getAssertionType()
STSClientConfigurationgetAssertionType in interface STSClientConfigurationpublic void setAssertionType(String assertionType)
STSClientConfigurationsetAssertionType in interface STSClientConfigurationpublic String getKeyType()
STSClientConfigurationgetKeyType in interface STSClientConfigurationpublic void setKeyType(String keyType)
STSClientConfigurationsetKeyType in interface STSClientConfigurationpublic String getKeySize()
STSClientConfigurationgetKeySize in interface STSClientConfigurationpublic void setKeySize(String keySize)
STSClientConfigurationsetKeySize in interface STSClientConfigurationpublic Boolean getUseKey()
STSClientConfigurationgetUseKey in interface STSClientConfigurationpublic void setUseKey(Boolean useKey)
STSClientConfigurationsetUseKey in interface STSClientConfigurationThis work is licensed under a Creative Commons Attribution 4.0 International License.