cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
87
Views
0
Helpful
0
Comments
cdnadmin
Level 11
Level 11
This document was generated from CDN thread

Created by: Duane Benson on 14-07-2010 01:27:04 PM
I am successfully using the TMS booking API by specifically setting the domain, username and password in a network credential object, however I would like to use the credentials of the currently logged on user who is running my application.

Do I need to capture these and set them as a network credential in my application (assuming that's possible)... or is there a simpler way for my app to simply pass through the current users credentials?

My application is a .NET component called by a custom outlook form.  The outlook form captures some booking details, and uses the .NET component to call the TMS API and create a booking in TMS.

Thanks!

Subject: RE: Authentication mechanisms
Replied by: Torgeir Johansen on 02-09-2010 08:50:24 AM
Duane,

you have to use impersonation to use the currently logged in user against the web service. If you have full control over your windows form/app, you can impersonate, call the web service, and then call the Undo() method. Or, perhaps better, set impersonation at Main() and release it when the app is closed ?

I suggest you use the WindowsImpersonationContext  class for this.To set up impersonation, you can use something like what's given in the example on msdn:
http://msdn.microsoft.com/en-us/library/system.security.principal.windowsimpersonationcontext.aspx

Regards,


Torgeir

Subject: RE: Authentication mechanisms
Replied by: Duane Benson on 02-09-2010 04:12:07 PM
Actually, I've found another way which doesn't seem to be documented, but it was confirmed by one of my Tandberg contacts to be a valid approach.  I'm posting it here for the future benefit of other users who may be trying to solve the same problem.

The following code snippet shows how (in C#) to automatically have the currently logged on user authenticate to the IIS server when calling the TMS API.  Assuming that this user account is configured in TMS, their account will be used to perform the booking.

private TMSBooking.BookingService myBooking = new TMSBooking.BookingService();
myBooking.UseDefaultCredentials = true;

… set up details…

try
{
   TMSBooking.Conference mySavedConference = myBooking.SaveConference(myNewConference);
}
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links