Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Access Denied using Windows Authentication. WSE 2.0

Reply
Thread Tools

Access Denied using Windows Authentication. WSE 2.0

 
 
Chey Zaga
Guest
Posts: n/a
 
      01-31-2004
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.SoapHttpClientProtoc ol.ReadResponse(SoapClient
Message message, WebResponse response, Stream responseStream, Boolean
asyncCall) at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.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\clientcredent ialsproxy.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.Ad d( token );
try
{
string xx = proxy.Test();
}
catch( Exception ex )
{
Response.Write( ex.ToString() );
}


Any help will be appreciated.
Thanks.


 
Reply With Quote
 
 
 
 
Arthur Nesterovsky
Guest
Posts: n/a
 
      02-02-2004
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.Ad d( 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



 
Reply With Quote
 
 
 
 
Chey Zaga
Guest
Posts: n/a
 
      02-02-2004
Thank you Arthur, that solved the issue.

"Arthur Nesterovsky" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
> 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.Ad d( 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
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Very annoying error: Access to the path is denied. ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity Jay ASP .Net 2 08-20-2007 07:38 PM
using wss4j client to access wse 3.0 web service Vijay Pandey ASP .Net Web Services 0 07-05-2006 06:00 AM
403 Forbidden: You were denied access because: Access denied by access control list Southern Kiwi NZ Computing 6 03-19-2006 05:19 AM
Access denied when using active directory groups and windows authentication David ASP .Net Security 14 11-04-2005 05:21 AM
Access Denied using Windows Authentication. WSE 2.0 Chey Zaga ASP .Net Web Services 0 01-31-2004 03:24 AM



Advertisments