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 / August 2005

Tip: Looking for answers? Try searching our database.

Unable to load the Custom Token Manager

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
vinay - 25 Aug 2005 20:06 GMT
I am trying to implement the UsernameTokenManager in WSE 3.0 and override the
AuthenticateToken to validate the username and password. But after doing this
i am getting a strange error when i run the client application

System.Web.Services.Protocols.SoapHeaderException: Server unavailable,
please try later --->System.ApplicationException: WSE842: The service
pipeline could not be created. -->
System.Configuration.ConfigurationErrorsException: WSE032: There was an error
loading the microsoft.web.services3 configuration section. --->
System.Configuration.Confi
gurationErrorsException: WSE040: Type MyUsernameTokenManager could not be
loaded. Please check the configuration file. (C:\temp\Webservice1\web.config
line 31)

Here is the web.config's security entry:

<security>
<securityTokenManager>
<add type="MyUsernameTokenManager"
namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecuri<BR>ty-secext-1.0.xsd" localName="UsernameToken" />
</securityTokenManager>
</security>

Can somebody let me know what wrong i am doing.

After going throught lot of blogs on web, i came to know that in the type(in
web.config entry): you need to mention the namespace followed by the custom
tokenmanager method name. But i am unable to understand what is the namespace
i need to give in Visual studio 2005 as if we use the http type and create a
webservice, then i am unable to see any namespace. (As i am very new to
Visual studio 2005). I dont know what is the default name space and the
project name i see is the http://localhost/....... (the virtual directory
location).

Can somebody let me know what is the error i am making.

Thanks
Regards
Vinay
Pablo Cibraro - 26 Aug 2005 14:08 GMT
Hi vinay,
Each security token has a namespace, in this case, according to the
WS-Security Specs,
the UsernameToken has the namespace
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd .
(This namespace is fixed, and you have to use always the same namespace for
Username tokens)
WSE uses this namespace to look for the token manager, which is a .NET
class. (If WSE doesn't find any configured token manager for the token's
namespace, it uses a default token manager for that token).
In your case, WSE can't load the class configured as token manager using the
attribute "type" (You should use the full qualified assembly name for that
type) , for example,
"MyNamespace.MyUsernameTokenManager, MyAssembly".
Another point to consider, "MyAssembly" should be in the GAC or the web site
"bin" folder.

Regards,
Pablo Cibraro
www.lagash.com

>I am trying to implement the UsernameTokenManager in WSE 3.0 and override
>the
[quoted text clipped - 44 lines]
> Regards
> Vinay
vinay - 26 Aug 2005 19:43 GMT
Hi Pablo

Thanks for the reply

I think i am missing something here or i am not understanding the concept
behind

regarding "MyNamespace.MyUsernameTokenManager, MyAssembly".

when you create a webservice project in visual studio 2005 and if you see
the code then you will find that there is no default namespace declared. Also
when you build the webservice, there is no "bin" folder generated and there
is no dll generated for that webservice as it is doing in visual studio 2003.
I know that in visual studio 2003 i am able to do this and also create custom
token manager working with WSE 2.0, but i am unable to understand why it is
not working in the new version of visual studio 2005 & WSE 3.0

So can you please let me know what has to be given for "MyNamespace" and
what should be done in visual studio 2005 to generate the dll for the
webservice project ???

Regards
Vinay

> Hi vinay,
> Each security token has a namespace, in this case, according to the
[quoted text clipped - 65 lines]
> > Regards
> > Vinay
Pablo Cibraro - 26 Aug 2005 21:42 GMT
Vinay,
Are the UsernameToken manager and the web service in the same web project ?.
If the token manager is implemented in other project, then you have to
reference it from the web service project.
"MyNamespace" is the namespace of your UsernameTokenManager class, if your
class doesn't have a namespace, then you don't have to specify it.

Maybe you can take a look to the "WSSecurityUsername" quickstart shipped
within WSE 3.0. It shows how to create and configure a custom username token
manager.

Regards,
Pablo Cibraro
www.lagash.com

> Hi Pablo
>
[quoted text clipped - 103 lines]
>> > Regards
>> > Vinay

Rate this thread:







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.