Sunday, February 19, 2012

How to Publish presence of a User in Lync with out knowing credential using UCMA 3.0

Publishing User Presence on to Lync Server Using UCMA 3.0 with out knowing Credentials




If you are building Trusted Server application using UCMA 3.0 and if you want to publish the presence of a user on to Lync server 2010  with out knowing his credentials is possible using UserEndpoint Class.


If you use Application Endpoint you can impersonate as a different user and you can make IM call, Audio/Video call  advantage using Application Endpoint is one endpoint will act on behalf of all users but where as if you use application endpoint you require n objects to act on behalf of n users.Disadvantage using Application Endpoint is you cannot publish the presence of a user and you cannot retrieve the contact list(Roster) of a user. To over come this we will go with UserEndpoint but this requires Credential of a user where as application endpoint doesnot require to subscribe or to send IM or Audio/Video calls.


If your requirement is to develop UCMA 3.0 application for Lync Server 2010 and publish presence of a user with out the knowledge of his password then you can use Trusted Server Platform settings and UserEndpoint


Follow the steps stated below


1) Create ServerPlatformSettings object



 // Name of this application, to be used as the outgoing user agent string in headers
     private static string _applicationUserAgent = "How2_UCMA20_AppProvisioning";
   
 // FQDN of the machine where the application is deployed, called "Server FQDN" in AppProvisoner.
     private static string _localHost = "TS.Fabrikam.com";
 // Port on which your application will listen, called "Listening Port" in AppProvisioner.
     private static int _port = 6000;
 // Trusted application GRUU for your application, called "Gruu" in Approvisioner.
  10:          private static string _gruu = "sip:TS.Fabrikam.com@Fabrikam.com;gruu;opaque=srvr:JimDaly_LabApp:drb9DrwtxkuUMmKwz3MFTQAA";
  

ServerPlatformSettings settings = new ServerPlatformSettings(_applicationUserAgent,_localHost, _port, _gruu,tlsCerts[0]);

_collabPlatform = new CollaborationPlatform(settings);

 _userEndpoint = new UserEndpoint(_collabPlatform); 


This does not require password other wise we require user password for initializing userendpoint





  • private Microsoft.Rtc.Signaling.SipAuthenticationProtocols _authProtocol = Microsoft.Rtc.Signaling.SipAuthenticationProtocols.Ntlm;
  • _collabPlatform.AllowedAuthenticationProtocol = _authProtocol;

_userEnpointSettings = new UserEnpointSetttings("owneruri","servername","serverport);

_userEndPoint = new UserEndpoint(_collabPlatform,_userEndpointSettings);

1 comment:

jibin said...

how can we specify the
X509Certificate certificate
parameter

Popular Posts