Gets the authentication information about Office Communicator. Not scriptable.

Syntax

HRESULT GetAuthenticationInfo([out, retval] BSTR* pbstrAuthInfo);

Parameters

pbstrAuthInfo

A pointer to a BSTR value containing the authentication information about Office Communicator.

Return Value

Returns one of the following values. For managed code applications, these return values are received in the form of a COMException.

S_OK

Success.

E_FAIL

One of the following reasons: Automation shut down, SIP Endpoint is null, or an XML string could not be created.

S_FALSE

Could not bring focus to the window.

RPC_X_NULL_REF_POINTER

pbstrAuthInfo is a null pointer.

Remarks

The authentication information is used by Microsoft Office to authenticate a licensed client. The authentication is returned in the form of an XML string. An example follows:

Copy Code
<authenticationinfo>
   <protocol>sip_kerberos</protocol>
</authenticationinfo>

Example

The following example code illustrates how to retrieve the authentication protocol in use by Office Communicator. Referencing communicator, a new IMessengerAdvanced object is created by casting the existing communicator object. The GetAuthenticationInfo method is called on a_communicator and an XML string is returned. The XML string is loaded into an XMLDocument object, authenticationDoc. The example code is using SelectSingleNode("XPATH string value") to access the element containing the authentication information.

Copy Code
using System.Xml;
using System.Xml.XPath;
// class code
...
// class code
IMessengerAdvanced a_communicator = (IMessengerAdvanced)communicator;
XmlDocument authenticationDoc = new XmlDocument();
if (a_communicator != null)
{
   try
   {
		authenticationDoc.LoadXml(a_communicator.GetAuthenticationInfo());
		 XmlElement protocolElement =
		 (XmlElement)authenticationDoc.SelectSingleNode("//protocol");
		 if (protocolElement != null)
			 Console.WriteLine("Authentication Protocol: " +
										protocolElement.InnerText);
		 else
			 Console.WriteLine("protocol node not found");
   }
   catch (XPathException XP)
   {
	 Console.WriteLine("XPATH error: " + XP.Message.ToString());
   }
   catch (COMException CE)
   {
	Console.WriteLine("COM Exception" + CE.ErrorCode.ToString());
   }
}

Requirements

Client

Requires Microsoft DirectX 9.0, C Runtime libraries (msvcm80.dll) on Microsoft Windows© Vista, Microsoft Windows XP Service Pack 1 (SP1) or later, or Microsoft Windows 2000 with Service Pack 4 (SP4). Any Communicator-imposed restrictions apply. .

Server

Requires Microsoft Office Communications Server 2007, AV MCU (for Media Support), Media Relay (for NAT/Firewall traversal) on Microsoft Office Communications Server 2007.

Product

Microsoft Office Communicator 2007 Automation API

IDL file

Msgrua.idl

See Also

Reference

IMessengerAdvanced