Re: WSE 2.0 - The security token could not be authenticated or authorized

From: dm_dal (REMOVE_THIS.dmy75252_at_yahoo.com)
Date: 06/08/04


Date: Tue, 8 Jun 2004 10:41:03 -0500

Thanks,
I understand that the Windows Authentication is failing. I'm trying to get
at WHY it is failing.

I'm using a local Windows account for the login and am using the correct
Username/Password combination.
I've tried: username, localmachine\username but both fail to authenticate.

dmy

"Govind Ramanathan" <govindr@microsoft.com> wrote in message
news:e4$lrsWTEHA.1168@TK2MSFTNGP11.phx.gbl...
> You have implemented AuthenticateUser as a web method. When you try to
call
> this method your request has the Username token in the request. On the
> service side WSE tries to validate the tokens in the request. As no
username
> token manger is registered the built in username token manger is called
and
> it does a logon user to use Windows Authentication. But this fails. So an
> error is returned by the WSE Pipeline itself.
>
> "dm_dal" <REMOVE_THIS.dmy75252@yahoo.com> wrote in message
> news:um12GdWTEHA.1472@TK2MSFTNGP12.phx.gbl...
> > I've seen similar post, but no real solutions. Can someone help me
> > understand what I need to do.
> >
> > I'm using the example given in the "Programming with Web Services
> > Enhancements 2.0" from the MS site. Heres the exception stack:
> >
> > Additional information: Microsoft.Web.Services2.Security.SecurityFault:
> The
> > security token could not be authenticated or authorized
> > at
> >
>
Microsoft.Web.Services2.Security.Tokens.UsernameTokenManager.OnLogonUserFail
> > ed(UsernameToken token)
> > at
> >
>
Microsoft.Web.Services2.Security.Tokens.UsernameTokenManager.LogonUser(Usern
> > ameToken token)
> > at
> >
>
Microsoft.Web.Services2.Security.Tokens.UsernameTokenManager.AuthenticateTok
> > en(UsernameToken token)
> > at
> >
>
Microsoft.Web.Services2.Security.Tokens.UsernameTokenManager.VerifyToken(Sec
> > urityToken securityToken)
> > at
> >
>
Microsoft.Web.Services2.Security.Tokens.SecurityTokenManager.LoadXmlSecurity
> > Token(XmlElement element)
> > at
> >
>
Microsoft.Web.Services2.Security.Tokens.SecurityTokenManager.GetTokenFromXml
> > (XmlElement element)
> > at Microsoft.Web.Services2.Security.Security.LoadXml(XmlElement
> element)
> > at
> >
>
Microsoft.Web.Services2.Security.SecurityInputFilter.ProcessMessage(SoapEnve
> > lope envelope)
> > at Microsoft.Web.Services2.Pipeline.ProcessInputMessage(SoapEnvelope
> > envelope)
> > at
> >
>
Microsoft.Web.Services2.WebServicesExtension.BeforeDeserializeServer(SoapSer
> > verMessage message)
> >
> >
> > Here's the code:
> >
> > Web Service
> > SimpleWseServer.ServicesMain.asmx
> >
> > [WebMethod]
> > public string AuthenticateUser(string username)
> > {
> > SoapContext ctxt = RequestSoapContext.Current;
> > foreach(SecurityToken token in ctxt.Security.Tokens)
> > {
> > if(token is UsernameToken)
> > {
> > UsernameToken user = (UsernameToken)token;
> > if(user.Username==username)
> > {
> > if(user.Principal.IsInRole(System.Net.Dns.GetHostName() +
@"\Kings"))
> > return "Hello, King " + username;
> > return "Hello, " + username;
> > }
> > }
> > }
> > return "Hello, Liar";
> > }
> >
> > Client App (windows form)
> >
> > private void btn_login_Click(object sender, System.EventArgs e)
> > {
> > string username = txt_username.Text;
> > string password = txt_password.Text;
> > SimpleWseClient.localhost.ServicesMainWse proxy = new
> > SimpleWseClient.localhost.ServicesMainWse();
> > proxy.Url = "http://localhost/SimpleWseServer/ServicesMain.asmx";
> > proxy.RequestSoapContext.Security.Tokens.Add(new
UsernameToken(username,
> > password, PasswordOption.SendPlainText));
> > txt_response.Text = proxy.AuthenticateUser(username);
> > }
> >
> > The username and password combination is setup on my local system and is
> > functioning properly. What have I missed?
> >
> > dmy
> >
> >
>
>



Relevant Pages

  • Re: Problems signing request when using Windows Authentication
    ... Even though a web-based UI may be set up for Windows authentication, ... >>> In the client I add a username token to the request. ... >>> security tokens in the request.", ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • RE: Problems signing request when using Windows Authentication
    ... Windows Authentication is enabled on the web form, I do not have access to ... > In the client I add a username token to the request. ... > security tokens in the request.", ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • RE: UserName token Access denied smart client
    ... I think what is happening is that you are trying to get a WSE username ... token security to interop with basic authentication. ... Username Tokens are not authenticated ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Accessing network when using windows authentication in web app
    ... I am using windows authentication in Apache to access the web page - ... How do I extract the username and password from the windows ... Would prefer to use the users username and password. ...
    (microsoft.public.dotnet.general)
  • Re: caching the UsernameToken
    ... but it calls the authentication code at every request. ... the tokens for a time. ... overrides the AuthenticateToken method. ... username in the token for rest of the call this issue could be ...
    (microsoft.public.dotnet.framework.webservices.enhancements)