Access Denied using Windows Authentication. WSE 2.0

Discussion in 'ASP .Net Web Services' started by Chey Zaga, Jan 31, 2004.

  1. Chey Zaga

    Chey Zaga Guest

    When using custom authentication (using the UsernameTokenManager interface.)
    I am able to log in, but can't authenticate using windows authentication.

    System:
    XP pro work station.
    My domain login had administrative privileges on my machine.
    WSE 2.0
    IIS: I checked off the anonymous access on the web service virtual
    directory.
    I have both the client and the web service on my local machine.

    Error Message:
    System.Net.WebException: The request failed with HTTP status 401: Access
    Denied. at
    System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClient
    Message message, WebResponse response, Stream responseStream, Boolean
    asyncCall) at
    System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
    methodName, Object[] parameters) at
    WebService1Client.WeblogProxy2.Service1Wse.Test() in
    c:\inetpub\wwwroot\webservice1client\web
    references\weblogproxy2\reference.cs:line 37 at
    WebService1Client.ClientCredentialsProxy.Page_Load(Object sender, EventArgs
    e) in
    c:\inetpub\wwwroot\webservice1client\clientcredentialsproxy.aspx.cs:line 52

    Client Code:
    // Create a UsernameToken
    UsernameToken token = new UsernameToken( Username, Password,,
    PasswordOption.SendPlainText);
    // Create an instance of the proxy
    WeblogProxy2.Service1Wse proxy = new WeblogProxy2.Service1Wse();
    // Add the SecurityToken to the Request
    Contextproxy.RequestSoapContext.Security.Tokens.Add( token );
    try
    {
    string xx = proxy.Test();
    }
    catch( Exception ex )
    {
    Response.Write( ex.ToString() );
    }


    Any help will be appreciated.
    Thanks.
     
    Chey Zaga, Jan 31, 2004
    #1
    1. Advertising

  2. Hi,

    > Client Code:
    > // Create a UsernameToken
    > UsernameToken token = new UsernameToken( Username, Password,,
    > PasswordOption.SendPlainText);
    > // Create an instance of the proxy
    > WeblogProxy2.Service1Wse proxy = new WeblogProxy2.Service1Wse();
    > // Add the SecurityToken to the Request
    > Contextproxy.RequestSoapContext.Security.Tokens.Add( token );
    > try
    > {
    > string xx = proxy.Test();
    > }
    > catch( Exception ex )
    > {
    > Response.Write( ex.ToString() );
    > }


    Try the following:

    // use the current logged in user's credentials
    proxy.Credentials = CredentialCache.DefaultCredentials;

    or

    // use the specified user's credentials
    proxy.Credentials = new NetworktCredentials(Username, Password, Domain);

    --
    ______________________________
    With best wishes, Arthur Nesterovsky
    Please visit my home page:
    http://www.nesterovsky-bros.com
     
    Arthur Nesterovsky, Feb 2, 2004
    #2
    1. Advertising

  3. Chey Zaga

    Chey Zaga Guest

    Thank you Arthur, that solved the issue.

    "Arthur Nesterovsky" <> wrote in
    message news:...
    > Hi,
    >
    > > Client Code:
    > > // Create a UsernameToken
    > > UsernameToken token = new UsernameToken( Username, Password,,
    > > PasswordOption.SendPlainText);
    > > // Create an instance of the proxy
    > > WeblogProxy2.Service1Wse proxy = new WeblogProxy2.Service1Wse();
    > > // Add the SecurityToken to the Request
    > > Contextproxy.RequestSoapContext.Security.Tokens.Add( token );
    > > try
    > > {
    > > string xx = proxy.Test();
    > > }
    > > catch( Exception ex )
    > > {
    > > Response.Write( ex.ToString() );
    > > }

    >
    > Try the following:
    >
    > // use the current logged in user's credentials
    > proxy.Credentials = CredentialCache.DefaultCredentials;
    >
    > or
    >
    > // use the specified user's credentials
    > proxy.Credentials = new NetworktCredentials(Username, Password, Domain);
    >
    > --
    > ______________________________
    > With best wishes, Arthur Nesterovsky
    > Please visit my home page:
    > http://www.nesterovsky-bros.com
    >
    >
    >
     
    Chey Zaga, Feb 2, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Daniel Bass
    Replies:
    5
    Views:
    5,499
    shijobaby
    Feb 6, 2010
  2. zlf
    Replies:
    1
    Views:
    520
  3. David
    Replies:
    14
    Views:
    854
    Patrick.O.Ige
    Nov 4, 2005
  4. Chey Zaga

    Access Denied using Windows Authentication. WSE 2.0

    Chey Zaga, Jan 31, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    131
    Chey Zaga
    Jan 31, 2004
  5. Ryan Taylor

    Windows Authentication and web services with WSE 2.0

    Ryan Taylor, Sep 6, 2005, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    343
    Prakash M
    Sep 7, 2005
Loading...

Share This Page