public abstract class AbstractSTSClient extends Object implements Configurable, InterceptorProvider
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractSTSClient.STSResponse |
Modifier and Type | Field and Description |
---|---|
protected Object |
actAs |
protected String |
addressingNamespace |
protected org.apache.wss4j.policy.model.AlgorithmSuite |
algorithmSuite |
protected boolean |
allowRenewing |
protected boolean |
allowRenewingAfterExpiry |
protected Bus |
bus |
protected Object |
claims |
protected CallbackHandler |
claimsCallbackHandler |
protected Client |
client |
protected String |
context |
protected Map<String,Object> |
ctx |
protected boolean |
enableAppliesTo |
protected boolean |
enableLifetime |
protected QName |
endpointName |
protected List<Feature> |
features |
protected List<Interceptor<? extends Message>> |
in |
protected List<Interceptor<? extends Message>> |
inFault |
protected boolean |
isSecureConv |
protected boolean |
isSpnego |
protected int |
keySize |
protected String |
keyType |
protected String |
location |
protected Message |
message |
protected String |
name |
protected String |
namespace |
protected Object |
onBehalfOf |
protected List<Interceptor<? extends Message>> |
out |
protected List<Interceptor<? extends Message>> |
outFault |
protected org.apache.neethi.Policy |
policy |
protected boolean |
requiresEntropy |
protected boolean |
sendKeyType |
protected boolean |
sendRenewing |
protected QName |
serviceName |
protected String |
soapVersion |
protected Element |
template |
protected String |
tokenType |
protected int |
ttl |
protected boolean |
useCertificateForConfirmationKeyInfo |
protected X509Certificate |
useKeyCertificate |
protected String |
wsdlLocation |
protected String |
wspNamespace |
Constructor and Description |
---|
AbstractSTSClient(Bus b) |
Modifier and Type | Method and Description |
---|---|
protected void |
addAppliesTo(XMLStreamWriter writer,
String appliesTo) |
protected void |
addBinaryExchange(String binaryExchange,
W3CDOMStreamWriter writer) |
protected void |
addClaims(XMLStreamWriter writer) |
protected void |
addKeySize(int keysize,
W3CDOMStreamWriter writer) |
protected void |
addLifetime(XMLStreamWriter writer) |
protected void |
addRequestType(String requestType,
W3CDOMStreamWriter writer) |
protected void |
addTokenType(XMLStreamWriter writer) |
protected AbstractSTSClient.STSResponse |
cancel(SecurityToken token)
Make an "Cancel" invocation and return the response as a STSResponse Object
|
void |
configureViaEPR(EndpointReferenceType ref,
boolean useEPRWSAAddrAsMEXLocation) |
protected void |
createClient() |
protected org.apache.wss4j.common.crypto.Crypto |
createCrypto(boolean decrypt) |
protected CallbackHandler |
createHandler() |
protected SecurityToken |
createSecurityToken(Element el,
byte[] requestorEntropy) |
protected byte[] |
decryptKey(Element child) |
protected String |
findID(Element rar,
Element rur,
Element rst) |
protected String |
findMEXLocation(Element ref) |
protected String |
findMEXLocation(EndpointReferenceType ref,
boolean useEPRWSAAddrAsMEXLocation) |
protected BindingOperationInfo |
findOperation(String suffix) |
Element |
getActAsToken()
Get the "ActAs" element to be sent to the STS.
|
protected PrimitiveAssertion |
getAddressingAssertion() |
String |
getBeanName()
Get the configurable object's Bean name
|
protected X509Certificate |
getCert(org.apache.wss4j.common.crypto.Crypto crypto) |
CallbackHandler |
getClaimsCallbackHandler() |
Client |
getClient() |
String |
getContext() |
protected Element |
getDelegationSecurityToken(Object delegationObject) |
protected Element |
getDocumentElement(DOMSource ds) |
QName |
getEndpointQName() |
List<Feature> |
getFeatures() |
protected String |
getIDFromSTR(Element el) |
List<Interceptor<? extends Message>> |
getInFaultInterceptors()
Returns the list of interceptors attached to the incoming fault interceptor
chain of the object.
|
List<Interceptor<? extends Message>> |
getInInterceptors()
Returns the list of interceptors attached to the incoming interceptor
chain of the object.
|
int |
getKeySize() |
String |
getLocation() |
Element |
getOnBehalfOfToken()
Get the "OnBehalfOf" element to be sent to the STS.
|
List<Interceptor<? extends Message>> |
getOutFaultInterceptors()
Returns the list of interceptors attached to the outgoing fault interceptor
chain of the object.
|
List<Interceptor<? extends Message>> |
getOutInterceptors()
Returns the list of interceptors attached to the outgoing interceptor
chain of the object.
|
Map<String,Object> |
getProperties() |
protected Object |
getProperty(String s) |
Map<String,Object> |
getRequestContext() |
QName |
getServiceQName() |
String |
getTokenType() |
X509Certificate |
getUseKeyCertificate() |
String |
getWsdlLocation() |
String |
getWspNamespace() |
boolean |
isAllowRenewing() |
boolean |
isAllowRenewingAfterExpiry() |
boolean |
isEnableAppliesTo() |
boolean |
isRequiresEntropy() |
boolean |
isSecureConv() |
boolean |
isSpnego() |
protected AbstractSTSClient.STSResponse |
issue(String appliesTo,
String action,
String requestType,
String binaryExchange)
Make an "Issue" invocation and return the response as a STSResponse Object
|
boolean |
isUseCertificateForConfirmationKeyInfo() |
AbstractSTSClient.STSResponse |
renew(SecurityToken tok)
Make an "Renew" invocation and return the response as a STSResponse Object
|
void |
setActAs(Object actAs) |
void |
setAddressingNamespace(String ad) |
void |
setAlgorithmSuite(org.apache.wss4j.policy.model.AlgorithmSuite ag) |
void |
setAllowRenewing(boolean allowRenewing) |
void |
setAllowRenewingAfterExpiry(boolean allowRenewingAfterExpiry) |
void |
setBeanName(String s) |
void |
setClaims(Object rstClaims)
Set a Claims Object to be included in the request.
|
void |
setClaimsCallbackHandler(CallbackHandler claimsCallbackHandler) |
void |
setContext(String context) |
void |
setEnableAppliesTo(boolean enableAppliesTo) |
void |
setEnableLifetime(boolean enableLifetime) |
void |
setEndpointName(String qn) |
void |
setEndpointQName(QName qn) |
void |
setFeatures(List<? extends Feature> f) |
void |
setInFaultInterceptors(List<Interceptor<? extends Message>> interceptors) |
void |
setInInterceptors(List<Interceptor<? extends Message>> interceptors) |
void |
setKeySize(int i) |
void |
setKeyType(String keyType) |
void |
setLocation(String location) |
void |
setMessage(Message message) |
void |
setNamespace(String namespace) |
void |
setOnBehalfOf(Object onBehalfOf) |
void |
setOnBehalfOfElement(Element onBehalfOfElement)
Deprecated.
|
void |
setOutFaultInterceptors(List<Interceptor<? extends Message>> interceptors) |
void |
setOutInterceptors(List<Interceptor<? extends Message>> interceptors) |
void |
setPolicy(Object newPolicy)
Sets the WS-P policy that is applied to communications between this client and the remote server
if no value is supplied for
setWsdlLocation(String) . |
protected void |
setPolicyInternal(Element newPolicy) |
protected void |
setPolicyInternal(org.apache.neethi.Policy newPolicy) |
protected void |
setPolicyInternal(String policyReference) |
void |
setProperties(Map<String,Object> p) |
void |
setRequiresEntropy(boolean requiresEntropy) |
void |
setSecureConv(boolean secureConv) |
void |
setSendKeyType(boolean sendKeyType) |
void |
setSendRenewing(boolean sendRenewing) |
void |
setServiceName(String qn) |
void |
setServiceQName(QName qn) |
void |
setSoap11() |
void |
setSoap11(boolean b) |
void |
setSoap12() |
void |
setSpnego(boolean spnego) |
void |
setTemplate(Element rstTemplate) |
void |
setTokenType(String tokenType) |
void |
setTrust(org.apache.wss4j.policy.model.Trust10 trust) |
void |
setTtl(int ttl) |
void |
setUseCertificateForConfirmationKeyInfo(boolean useCertificate)
Indicate whether to use the signer's public X509 certificate for the subject confirmation key info
when creating a RequestsSecurityToken message.
|
void |
setUseKeyCertificate(X509Certificate useKeyCertificate) |
void |
setWsdlLocation(String wsdl) |
void |
setWspNamespace(String wspNamespace) |
protected boolean |
useSecondaryParameters() |
protected AbstractSTSClient.STSResponse |
validate(SecurityToken tok,
String tokentype)
Make an "Validate" invocation and return the response as a STSResponse Object
|
protected void |
writeElementsForRSTPublicKey(W3CDOMStreamWriter writer,
X509Certificate cert) |
protected byte[] |
writeElementsForRSTSymmetricKey(W3CDOMStreamWriter writer,
boolean wroteKeySize) |
protected String |
writeKeyType(W3CDOMStreamWriter writer,
String keyTypeToWrite) |
protected Bus bus
protected String name
protected Client client
protected String location
protected String wsdlLocation
protected QName serviceName
protected QName endpointName
protected org.apache.neethi.Policy policy
protected String soapVersion
protected int keySize
protected boolean requiresEntropy
protected Element template
protected Object claims
protected CallbackHandler claimsCallbackHandler
protected org.apache.wss4j.policy.model.AlgorithmSuite algorithmSuite
protected String namespace
protected String addressingNamespace
protected String wspNamespace
protected Object onBehalfOf
protected boolean enableAppliesTo
protected boolean useCertificateForConfirmationKeyInfo
protected boolean isSecureConv
protected boolean isSpnego
protected boolean enableLifetime
protected int ttl
protected boolean sendRenewing
protected boolean allowRenewing
protected boolean allowRenewingAfterExpiry
protected Object actAs
protected String tokenType
protected String keyType
protected boolean sendKeyType
protected Message message
protected String context
protected X509Certificate useKeyCertificate
protected List<Interceptor<? extends Message>> in
protected List<Interceptor<? extends Message>> out
protected List<Interceptor<? extends Message>> outFault
protected List<Interceptor<? extends Message>> inFault
public AbstractSTSClient(Bus b)
public String getBeanName()
Configurable
getBeanName
in interface Configurable
public void setBeanName(String s)
public String getLocation()
public void setLocation(String location)
public void setMessage(Message message)
public void setTtl(int ttl)
public void setEnableLifetime(boolean enableLifetime)
public void setSendRenewing(boolean sendRenewing)
public void setPolicy(Object newPolicy)
setWsdlLocation(String)
.
Accepts Policy
or Element
as input.newPolicy
- the policy objectIllegalArgumentException
- if newPolicy
is not one of the supported types.public void setSoap12()
public void setSoap11()
public void setSoap11(boolean b)
public void setAddressingNamespace(String ad)
public void setTrust(org.apache.wss4j.policy.model.Trust10 trust)
public boolean isRequiresEntropy()
public void setRequiresEntropy(boolean requiresEntropy)
public boolean isSecureConv()
public void setSecureConv(boolean secureConv)
public boolean isSpnego()
public void setSpnego(boolean spnego)
public boolean isAllowRenewing()
public void setAllowRenewing(boolean allowRenewing)
public boolean isAllowRenewingAfterExpiry()
public void setAllowRenewingAfterExpiry(boolean allowRenewingAfterExpiry)
public boolean isEnableAppliesTo()
public void setEnableAppliesTo(boolean enableAppliesTo)
public String getContext()
public void setContext(String context)
public void setAlgorithmSuite(org.apache.wss4j.policy.model.AlgorithmSuite ag)
public void setWsdlLocation(String wsdl)
public String getWsdlLocation()
public void setServiceName(String qn)
public void setEndpointName(String qn)
public void setServiceQName(QName qn)
public QName getServiceQName()
public void setEndpointQName(QName qn)
public QName getEndpointQName()
public void setActAs(Object actAs)
public void setKeySize(int i)
public int getKeySize()
public void setTokenType(String tokenType)
public String getTokenType()
public void setSendKeyType(boolean sendKeyType)
public void setKeyType(String keyType)
@Deprecated public void setOnBehalfOfElement(Element onBehalfOfElement)
public void setOnBehalfOf(Object onBehalfOf)
public void setUseCertificateForConfirmationKeyInfo(boolean useCertificate)
public boolean isUseCertificateForConfirmationKeyInfo()
protected void setPolicyInternal(org.apache.neethi.Policy newPolicy)
protected void setPolicyInternal(Element newPolicy)
protected void setPolicyInternal(String policyReference)
public Client getClient() throws BusException, EndpointException
BusException
EndpointException
public void configureViaEPR(EndpointReferenceType ref, boolean useEPRWSAAddrAsMEXLocation)
protected String findMEXLocation(EndpointReferenceType ref, boolean useEPRWSAAddrAsMEXLocation)
protected void createClient() throws BusException, EndpointException
BusException
EndpointException
protected BindingOperationInfo findOperation(String suffix)
protected AbstractSTSClient.STSResponse issue(String appliesTo, String action, String requestType, String binaryExchange) throws Exception
Exception
public Element getOnBehalfOfToken() throws Exception
Exception
public Element getActAsToken() throws Exception
Exception
protected Element getDelegationSecurityToken(Object delegationObject) throws Exception
Exception
protected byte[] writeElementsForRSTSymmetricKey(W3CDOMStreamWriter writer, boolean wroteKeySize) throws Exception
Exception
protected void writeElementsForRSTPublicKey(W3CDOMStreamWriter writer, X509Certificate cert) throws Exception
Exception
protected void addBinaryExchange(String binaryExchange, W3CDOMStreamWriter writer) throws XMLStreamException
XMLStreamException
protected void addKeySize(int keysize, W3CDOMStreamWriter writer) throws XMLStreamException
XMLStreamException
protected void addRequestType(String requestType, W3CDOMStreamWriter writer) throws XMLStreamException
XMLStreamException
public AbstractSTSClient.STSResponse renew(SecurityToken tok) throws Exception
Exception
protected PrimitiveAssertion getAddressingAssertion()
protected AbstractSTSClient.STSResponse validate(SecurityToken tok, String tokentype) throws Exception
Exception
protected AbstractSTSClient.STSResponse cancel(SecurityToken token) throws Exception
Exception
protected boolean useSecondaryParameters()
protected String writeKeyType(W3CDOMStreamWriter writer, String keyTypeToWrite) throws XMLStreamException
XMLStreamException
protected X509Certificate getCert(org.apache.wss4j.common.crypto.Crypto crypto) throws Exception
Exception
protected void addLifetime(XMLStreamWriter writer) throws XMLStreamException
XMLStreamException
protected void addAppliesTo(XMLStreamWriter writer, String appliesTo) throws XMLStreamException
XMLStreamException
protected void addTokenType(XMLStreamWriter writer) throws XMLStreamException
XMLStreamException
protected void addClaims(XMLStreamWriter writer) throws Exception
Exception
protected SecurityToken createSecurityToken(Element el, byte[] requestorEntropy) throws org.apache.wss4j.common.ext.WSSecurityException, org.apache.xml.security.exceptions.Base64DecodingException
org.apache.wss4j.common.ext.WSSecurityException
org.apache.xml.security.exceptions.Base64DecodingException
protected byte[] decryptKey(Element child) throws TrustException, org.apache.wss4j.common.ext.WSSecurityException, org.apache.xml.security.exceptions.Base64DecodingException
TrustException
org.apache.wss4j.common.ext.WSSecurityException
org.apache.xml.security.exceptions.Base64DecodingException
protected CallbackHandler createHandler()
protected org.apache.wss4j.common.crypto.Crypto createCrypto(boolean decrypt) throws IOException, org.apache.wss4j.common.ext.WSSecurityException
IOException
org.apache.wss4j.common.ext.WSSecurityException
public void setTemplate(Element rstTemplate)
public void setClaims(Object rstClaims)
public List<Interceptor<? extends Message>> getOutFaultInterceptors()
InterceptorProvider
getOutFaultInterceptors
in interface InterceptorProvider
List
outgoing fault interceptor chainpublic List<Interceptor<? extends Message>> getInFaultInterceptors()
InterceptorProvider
getInFaultInterceptors
in interface InterceptorProvider
List
incoming fault interceptor chainpublic List<Interceptor<? extends Message>> getInInterceptors()
InterceptorProvider
getInInterceptors
in interface InterceptorProvider
List
incoming interceptor chainpublic List<Interceptor<? extends Message>> getOutInterceptors()
InterceptorProvider
getOutInterceptors
in interface InterceptorProvider
List
outgoing interceptor chainpublic void setInInterceptors(List<Interceptor<? extends Message>> interceptors)
public void setInFaultInterceptors(List<Interceptor<? extends Message>> interceptors)
public void setOutInterceptors(List<Interceptor<? extends Message>> interceptors)
public void setOutFaultInterceptors(List<Interceptor<? extends Message>> interceptors)
public CallbackHandler getClaimsCallbackHandler()
public void setClaimsCallbackHandler(CallbackHandler claimsCallbackHandler)
public String getWspNamespace()
public void setWspNamespace(String wspNamespace)
public X509Certificate getUseKeyCertificate()
public void setUseKeyCertificate(X509Certificate useKeyCertificate)
public void setNamespace(String namespace)
Apache CXF