1

I am trying to connect to Office Communication Server using the Unified Communications Managed API. I have tried my user and a fresh user enabled for OCS. Both account can successfully log into the Office Communicator client, but fail using the API. When creating the network credential, if I pass in the username in the form domain\username, I get this error:

SupportedAuthenticationProtocols=Ntlm, Kerberos
Realm=SIP Communications Service
FailureReason=InvalidCredentials
ErrorCode=-2146893044
Microsoft.Rtc.Signaling.AuthenticationException: The log on was denied. Check that the proper credentials are being used and the account is active. ---> Microsoft.Rtc.Internal.Sip.AuthException: NegotiateSecurityAssociation failed, error: - 2146893044

If I leave off the domain in the username I this error:

ResponseCode=404 ResponseText=Not Found
DiagnosticInformation=ErrorCode=4005,Source=OCS.mydomain.com,Reason=Destination URI either not enabled for SIP or does not exist
William Holroyd
  • 3,344
  • 1
  • 21
  • 25
Robin Clowers
  • 2,150
  • 18
  • 28

2 Answers2

2

Turns out this was an oversight on my part. Our AD domain and communicator domain are different, I had assumed they were the same.

The network credential is domain\username, and the sip address should have been sip:username@companyname.com, I was using sip:username@domain.com.

Robin Clowers
  • 2,150
  • 18
  • 28
0

Two things to note:

  1. Username should not contain the domain. There should be a separate Domain property of NetworkCredential that you should be using.
  2. You also need to pass in the user URI as well - for example:

//Initialize and register the endpoint, using the credentials of the user the application will be acting as.
        UserEndpointSettings userEndpointSettings = new UserEndpointSettings(_userURI, _userServer);
        userEndpointSettings.Credential = _credential;
        _userEndpoint = new UserEndpoint(_collabPlatform, userEndpointSettings);
        _userEndpoint.BeginEstablish(EndEndpointEstablish, _userEndpoint);

adeel825
  • 5,677
  • 12
  • 40
  • 44
  • Thanks for the response, I am doing both of those things; however, I am using the CollaborationPlatform not the UserEndpoint. The error I am getting is from a sample included with the UCMA called Basic IM Call. – Robin Clowers Jan 07 '10 at 23:51