microsoft.exchange.webservices.data.credential
Class WSSecurityBasedCredentials

java.lang.Object
  extended by microsoft.exchange.webservices.data.credential.ExchangeCredentials
      extended by 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
protected static String wsAddressingHeadersFormat
          The Constant WsAddressingHeadersFormat.
protected static String wsSecurityHeaderFormat
          The Constant WsSecurityHeaderFormat.
protected static String wsSecurityPathSuffix
          The Constant WsSecurityPathSuffix.
protected static String wsuTimeStampFormat
           
 
Constructor Summary
protected WSSecurityBasedCredentials()
          Initializes a new instance of the WSSecurityBasedCredentials class.
protected WSSecurityBasedCredentials(String securityToken)
          Initializes a new instance of the WSSecurityBasedCredentials class.
protected WSSecurityBasedCredentials(String securityToken, boolean addTimestamp)
          Initializes a new instance of the WSSecurityBasedCredentials class.
 
Method Summary
 URI adjustUrl(URI url)
          Adjusts the URL based on the credential.
 void emitExtraSoapHeaderNamespaceAliases(XMLStreamWriter writer)
          Emit the extra namespace aliases used for WS-Security and WS-Addressing.
protected  URI getEwsUrl()
          Gets the EWS URL.
protected  String getSecurityToken()
          Gets the security token.
 void preAuthenticate()
          This method is called to pre-authenticate credential before a service request is made.
 void serializeExtraSoapHeaders(XMLStreamWriter writer, String webMethodName)
          Serialize the WS-Security and WS-Addressing SOAP headers.
 void serializeWSSecurityHeaders(XMLStreamWriter xmlWriter)
          Creates the WS-Security header necessary to send with an outgoing request.
protected  void setEwsUrl(URI value)
          Sets the EWS URL.
protected  void setSecurityToken(String value)
          Sets the security token.
 
Methods inherited from class microsoft.exchange.webservices.data.credential.ExchangeCredentials
getExchangeCredentialsFromNetworkCredential, getUriWithoutWSSecurity, isNeedSignature, prepareWebRequest, sign
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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:
preAuthenticate in class ExchangeCredentials

emitExtraSoapHeaderNamespaceAliases

public void emitExtraSoapHeaderNamespaceAliases(XMLStreamWriter writer)
                                         throws XMLStreamException
Emit the extra namespace aliases used for WS-Security and WS-Addressing.

Overrides:
emitExtraSoapHeaderNamespaceAliases in class ExchangeCredentials
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:
serializeExtraSoapHeaders in class ExchangeCredentials
Parameters:
writer - the writer
webMethodName - 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:
serializeWSSecurityHeaders in class ExchangeCredentials
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:
adjustUrl in class ExchangeCredentials
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.


getEwsUrl

protected URI getEwsUrl()
Gets the EWS URL.


setEwsUrl

protected void setEwsUrl(URI value)
Sets the EWS URL.



Copyright © 2012–2015 Microsoft. All rights reserved.