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

Tip: Looking for answers? Try searching our database.

Custom Username token in WSE 3.0

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
n33470 - 29 Nov 2005 13:51 GMT
Hi all,

Using WSE 3.0, I need to create a custom username token that includes
some additional fields.   I have also created a custom token manager to
handle the authentication process using the custom token.   (For
example, suppose you wanted to add an additional string field to the
username token that would be used during the authentication process.)

Should I be able to get this to work using just these two customized
classes, along with the standard UsernameForCertificate policy
assertion?   Or, will I need to also create a custom policy assertion
as well?

Here is a small sample of the client code:
           token = new DMO.UserToken("sjn", "pass", "ABC Trucking
Co.");
           serviceProxy.SetClientCredential(token);

Here is the stanza from the app.config for the client app which sets
the custom username token manager:
 <microsoft.web.services3>
   <security>
     <x509 allowTestRoot="true" />
     <securityTokenManager>
       <add type="DMO.XmlTokenManager, SampleBase"
namespace="http://www.contoso.com/tokens/customXml"
localName="XmlToken" />
     </securityTokenManager>
   </security>
   <policy fileName="wse3policyCache.config" />
   <tokenIssuer>
     <statefulSecurityContextToken enabled="true" />
   </tokenIssuer>
 </microsoft.web.services3>

When I execute the method in the serviceProxy, I get the following
error:
Unable to determine client token to use. Client token type requested
was 'Microsoft.Web.Services3.Security.Tokens.UsernameToken'.

If this should be possible, have I missed a configuration step, or
something?

--steve
Pablo Cibraro - 29 Nov 2005 15:46 GMT
Hi Steve,
The UsernameForCertificate  assertion only works for Username tokens. You
will have to develop a custom assertion to use your custom token.
Have you tried deriving your custom token from the UsernameToken class? (I'm
not completely sure if this works).

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

> Hi all,
>
[quoted text clipped - 40 lines]
>
> --steve
n33470 - 29 Nov 2005 20:03 GMT
Pablo,

Thanks for the reply!  I've been able to get something almost working,
but at this point it does not involve creating a new assertion.  It's
not fully working, but it seems close.

I have a custom username token object (derived from UsernameToken), a
custom username token provider (derived from UsernameTokenProvider) and
a custom username token manager (derived from UsernameTokenManager).

I can put the custom user token into the service proxy and call the
service.   When I get into the service it receives the custom token.
However the extended properties of the custom user token are not in the
XmlElement passed to the consructor of the custom user token.

The help topic "Creating Custom Security Tokens" in the WSE 3.0 docs is
exactly what I'm trying to do.   I wish that a full solution was
provided for that example.   This was provided as a full solution in
WSE 2.0, but not in the 3.0 QuickStarts.

--steve
Pablo Cibraro - 30 Nov 2005 19:48 GMT
Hi Steve,
I recommend you to take a look in this GDN workspace
http://practices.gotdotnet.com/projects/saml
That project is custom implementation of a SAML token using WSE 3.0 (It is
helpful to see how to implement a custom token).

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

> Pablo,
>
[quoted text clipped - 17 lines]
>
> --steve

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.