all groups > dotnet web services enhancements > may 2006 >
You're in the

dotnet web services enhancements

group:

WSE 2 with VS2005 and custom UsernameTokenManager



WSE 2 with VS2005 and custom UsernameTokenManager Julian Jelfs
5/23/2006 3:47:01 AM
dotnet web services enhancements: 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,

RE: WSE 2 with VS2005 and custom UsernameTokenManager Julian Jelfs
5/23/2006 6:03:01 AM
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.

[quoted text, click to view]
AddThis Social Bookmark Button