Class WSSecurityBasedCredentials
- java.lang.Object
-
- microsoft.exchange.webservices.data.credential.ExchangeCredentials
-
- microsoft.exchange.webservices.data.credential.WSSecurityBasedCredentials
-
- Direct Known Subclasses:
TokenCredentials,WindowsLiveCredentials
public abstract class WSSecurityBasedCredentials extends ExchangeCredentials
WSSecurityBasedCredentials is the base class for all credential classes using WS-Security.
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringwsAddressingHeadersFormatThe Constant WsAddressingHeadersFormat.protected static StringwsSecurityHeaderFormatThe Constant WsSecurityHeaderFormat.protected static StringwsSecurityPathSuffixThe Constant WsSecurityPathSuffix.protected static StringwsuTimeStampFormat
-
Constructor Summary
Constructors Modifier Constructor Description protectedWSSecurityBasedCredentials()Initializes a new instance of the WSSecurityBasedCredentials class.protectedWSSecurityBasedCredentials(String securityToken)Initializes a new instance of the WSSecurityBasedCredentials class.protectedWSSecurityBasedCredentials(String securityToken, boolean addTimestamp)Initializes a new instance of the WSSecurityBasedCredentials class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description URIadjustUrl(URI url)Adjusts the URL based on the credential.voidemitExtraSoapHeaderNamespaceAliases(XMLStreamWriter writer)Emit the extra namespace aliases used for WS-Security and WS-Addressing.protected URIgetEwsUrl()Gets the EWS URL.protected StringgetSecurityToken()Gets the security token.voidpreAuthenticate()This method is called to pre-authenticate credential before a service request is made.voidserializeExtraSoapHeaders(XMLStreamWriter writer, String webMethodName)Serialize the WS-Security and WS-Addressing SOAP headers.voidserializeWSSecurityHeaders(XMLStreamWriter xmlWriter)Creates the WS-Security header necessary to send with an outgoing request.protected voidsetEwsUrl(URI value)Sets the EWS URL.protected voidsetSecurityToken(String value)Sets the security token.-
Methods inherited from class microsoft.exchange.webservices.data.credential.ExchangeCredentials
getExchangeCredentialsFromNetworkCredential, getUriWithoutWSSecurity, isNeedSignature, prepareWebRequest, sign
-
-
-
-
Field Detail
-
wsuTimeStampFormat
protected static final String wsuTimeStampFormat
- See Also:
- Constant Field Values
-
wsAddressingHeadersFormat
protected static final String wsAddressingHeadersFormat
The Constant WsAddressingHeadersFormat.- See Also:
- Constant Field Values
-
wsSecurityHeaderFormat
protected static final String wsSecurityHeaderFormat
The Constant WsSecurityHeaderFormat.- See Also:
- Constant Field Values
-
wsSecurityPathSuffix
protected static final String wsSecurityPathSuffix
The Constant WsSecurityPathSuffix.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
WSSecurityBasedCredentials
protected WSSecurityBasedCredentials()
Initializes a new instance of the WSSecurityBasedCredentials class.
-
WSSecurityBasedCredentials
protected WSSecurityBasedCredentials(String securityToken)
Initializes a new instance of the WSSecurityBasedCredentials class.- Parameters:
securityToken- The security token.
-
WSSecurityBasedCredentials
protected WSSecurityBasedCredentials(String securityToken, boolean addTimestamp)
Initializes a new instance of the WSSecurityBasedCredentials class.- Parameters:
securityToken- The security token.addTimestamp- Timestamp should be added.
-
-
Method Detail
-
preAuthenticate
public void preAuthenticate()
This method is called to pre-authenticate credential before a service request is made.- Overrides:
preAuthenticatein classExchangeCredentials
-
emitExtraSoapHeaderNamespaceAliases
public void emitExtraSoapHeaderNamespaceAliases(XMLStreamWriter writer) throws XMLStreamException
Emit the extra namespace aliases used for WS-Security and WS-Addressing.- Overrides:
emitExtraSoapHeaderNamespaceAliasesin classExchangeCredentials- Parameters:
writer- the writer- Throws:
XMLStreamException- the XML stream exception
-
serializeExtraSoapHeaders
public void serializeExtraSoapHeaders(XMLStreamWriter writer, String webMethodName) throws XMLStreamException
Serialize the WS-Security and WS-Addressing SOAP headers.- Overrides:
serializeExtraSoapHeadersin classExchangeCredentials- Parameters:
writer- the writerwebMethodName- the Web method being called- Throws:
XMLStreamException- the XML stream exception
-
serializeWSSecurityHeaders
public void serializeWSSecurityHeaders(XMLStreamWriter xmlWriter) throws XMLStreamException
Creates the WS-Security header necessary to send with an outgoing request.- Overrides:
serializeWSSecurityHeadersin classExchangeCredentials- Parameters:
xmlWriter- The XML writer to serialize the headers to- Throws:
XMLStreamException- the XML stream exception
-
adjustUrl
public URI adjustUrl(URI url) throws URISyntaxException
Adjusts the URL based on the credential.- Overrides:
adjustUrlin classExchangeCredentials- Parameters:
url- The URL.- Returns:
- Adjust URL.
- Throws:
URISyntaxException- the uRI syntax exception
-
getSecurityToken
protected String getSecurityToken()
Gets the security token.
-
setSecurityToken
protected void setSecurityToken(String value)
Sets the security token.
-
-