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 / May 2006

Tip: Looking for answers? Try searching our database.

WSE 2 with VS2005 and custom UsernameTokenManager

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Julian Jelfs - 23 May 2006 11:47 GMT
Hi, I am working with the following setup.

I have a web service that was orignally created in VS 2003 and has now been
converted to VS2005. I have a custom UsernameTokenManager that was originally
defined in a file that was part of my web service project. My custom token
manager doesn't do a lot. It uses the username and password in the token to
create a GenericPrincipal which is then assigned to the token's Principal
property. The token manager then returns the token's password. (Don't worry
about the security of this setup, it's not an issue for me).

With this in place, by the time I got to my web method, the User.Identity
property was populated with the details of the user I had supplied in my
username token and I could use that information in my business logic.

Then I upgraded the web service project to VS 2005. This made the changes it
makes, put my token manager class in to the App_Code directory etc etc. The
upshot was that I would get a configuration error saying it couldn't load the
token manager. So I moved the token manager class to a separate project as
this seemed to be the only was I could get it to load properly and overcome
the configuration error.

Now, all works exactly as before apparently. I can step through the code in
debug and it all looks fine, the token comes through fine, the
token.Principal property gets set fine. But, when I get to my web method the
User.Identity is blank and not authenticated which means my application stops
working.

I don't know if the convertion to VS2005 is a red herring or if it's
significant. Is it something to do with moving the token manager to a
separate project (and therefore a separate assembly)? Is there some
incompatibility between VS2005 and WSE 2.0?

If anyone has any ideas I would be very grateful.

Thanks in advance,

Julian Jelfs.
Julian Jelfs - 23 May 2006 14:03 GMT
Hi,

I have done some more tested and I now have the token manager class back in
the same project as the web service so I think I call rule that out as a
factor. However, despite the fact that I am correctly assigning the token's
principal property in the AuthenticateToken override and returning the
correct password, I do not see the Identity being carride through into the
Web Method (i.e. I cannot see anything in User.Identity).

Could this be anything to do with the IIS settings for the web service
directory? or any other web.config settings such as authentication /
identity?

IIS is currently set to anonymous which I think is correct. Well, I've tried
all the combinations I can think of anyway?

Any ideas very welcome.

Thanks,

Julian Jelfs.

> Hi, I am working with the following setup.
>
[quoted text clipped - 33 lines]
>
> Julian Jelfs.

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.