Re: Custom UsernameTokenManager's AuthenticateToken method is not called.
- From: "Pablo Cibraro [MVP]" <pcibraro@xxxxxxxxxxx>
- Date: Thu, 30 Nov 2006 09:52:14 -0500
Hi,
It seems to be an error in the localName value, you are using UserNameToken,
but it should be UsernameToken.
Regards,
Pablo Cibraro.
"DEotw" <DarkEnemyOfTheWorld@xxxxxxxxx> wrote in message
news:1164840146.890618.168030@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I am trying to create a custom UsernameTokenManager with WSE 3.0. The
class seems to be be instantiated ( I can debug the constructor as it
runs if I put one in), but the overridden AuthenticateToken method is
never called, instead the normal one is apparently used (I can access
the web services using a local user account. Below I am posting my
CustomUsernameTokenManager class, web.config file and
wse3policyCache.config file. As you can see, I am just trying to get it
to run, I have tried to strip everything down as much as possible. Any
suggestions would be appreciated.I'm not for sure how common a problem
this is, I haven't found anything very helpful on the web. I can
provide more info if needed.
CustomUsernameTokenManager Class:
using System;
using System.Xml;
using System.Security.Permissions;
using System.Web.Security;
using System.Security.Principal;
using Microsoft.Web.Services3.Security;
using Microsoft.Web.Services3.Security.Tokens;
namespace CompanyProject
{
[SecurityPermissionAttribute(SecurityAction.Demand,
Flags=SecurityPermissionFlag.UnmanagedCode)]
public class CustomUsernameTokenManager : UsernameTokenManager
{
protected override string AuthenticateToken(UsernameToken
token)
{
return "test";
}
}
}
Portion of web.config:
<webServices>
<soapExtensionImporterTypes>
<add
type="Microsoft.Web.Services3.Description.WseExtensionImporter,
Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" />
</soapExtensionImporterTypes>
<soapServerProtocolFactory
type="Microsoft.Web.Services3.WseProtocolFactory,
Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" />
</webServices>
</system.web>
<microsoft.web.services3>
<security>
<securityTokenManager>
<add type="CompanyProject.CustomUsernameTokenManager"
namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
localName="UserNameToken" />
</securityTokenManager>
</security>
<policy fileName="wse3policyCache.config" />
</microsoft.web.services3>
wse3policyCache.config:
<policies
xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<extensions>
<extension name="usernameOverTransportSecurity"
type="Microsoft.Web.Services3.Design.UsernameOverTransportAssertion,
Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" />
</extensions>
<policy name="usernameTokenSecurity">
<usernameOverTransportSecurity />
</policy>
</policies>
.
- Follow-Ups:
- References:
- Prev by Date: Cannot use usernameForCertificateSecurity with IIS application pool custom account
- Next by Date: Re: Cannot use usernameForCertificateSecurity with IIS application pool custom account
- Previous by thread: Custom UsernameTokenManager's AuthenticateToken method is not called.
- Next by thread: Re: Custom UsernameTokenManager's AuthenticateToken method is not called.
- Index(es):
Relevant Pages
|