Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / April 2006

Tip: Looking for answers? Try searching our database.

Custom UsernameTokenManager for different webservices

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Damian - 11 Apr 2006 13:01 GMT
Hi There

Is it possible to specifiy which custom usernametokenmanager to use for
individual webservices?

I currently have some webservices that are consumed by a smartclient,
for which i use a custom usernameTokenManager to autheticated against
our uses db. This works wonderfully at the moment!
But now i have another system which needs to consume a different set of
webservices in my application but i need to authenticate against
another source.

Any ideas?

Thanks very much
Damian
Pablo Cibraro - 11 Apr 2006 14:56 GMT
Hi Damian,

You have two workarounds to that problem,

1. You can host the set of web services in a different virtual directory
with a different configuration
2. You can use the addressing headers to determine the URL for the target
service, and use a different authentication mechanism according to that.

For example

protected override string AuthenticateToken( UsernameToken token )
{
      if(SoapContext.Current.Addressing.To.Value == http://service1.asmx)
        //Authenticate the user against a database
     else if(SoapContext.Current.Addressing.To.Value ==
http://service2.asmx)
       //Authenticate the user against windows
}

Other solution is to use the brokered authentication pattern:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/WSS
_Ch1_BrokAuthSTS.asp


Regards,
Pablo Cibraro
http://weblogs.asp.net/cibrax

> Hi There
>
[quoted text clipped - 12 lines]
> Thanks very much
> Damian

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.