Ask a Question related to ASP.NET Security, Design and Development.
-
mklapp #1
Illegal to mix Authentication methods ?
Hello,
I have a Web Service, a Winform client and a web Application. The Web App and the WinForm Client use the same Web Service (or such is the plan).
The WinForm Client and the Webservice work together using Integrated Windows Authentication and works well.
The nature of the Web App, compels me to use Forms authentication. The default page redirects to the login page for the login. The login screen access the Web Service through the proxy generated by WSDL.exe.
The intent is to only allow authenticated windows users to reach the Login screen in the first place. After the login screen, access to the App pages will be via cookie authentication. Each of the web pages access the Web Service (through the proxy). Anonymous access is turned off. Where authentication can be specified in the App path through IIS, it has been set to Integrated Windows.
The code :
Line 42: pss = FormsAuthentication.HashPasswordForStoringInConfig File(txtPss.Text, "sha1")
Line 43:
Line 44: If proxy.ValidateUser(txtUser.Text, pss) Then <-----------The bad line
Line 45: FormsAuthentication.RedirectFromLoginPage(txtUser. Text, False)
Line 46: Else
The returned exception is below.
WebException: The request failed with HTTP status 401: Access Denied.]
System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String methodName, Object[] parameters)
MABillingService.ValidateUser(String UserId, String psswd)
_3rdPartyWeb.login.btnLogin_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\3rdPartyWeb\login.aspx.vb:44
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
System.Web.UI.Page.ProcessRequestMain()
Must I set authentication to Anonymous if I am using Forms? Can one client use Integrated Windows with a web service while another uses Forms through the proxy for the same service?
I have read a lot, but everything is spread all over the place and little of it is tied together.
mklapp Guest
-
Illegal Name
What is see is CFIF NOT IsDefined ("SESSION.ahh")> CFLOCK scope="session" throwontimeout="no" timeout="10" -
Authentication methods...
Hi, We're likelly to have both internal and external systems on our servers. We've only got one IIS server (Charity!). Is there going to be... -
#26350 [NEW]: Inherited methods can't access private methods
From: forseti at oak dot rpg dot pl Operating system: Windows 98 SE PHP version: 5.0.0b2 (beta2) PHP Bug Type: Zend Engine 2... -
Really confused about authorization/authentication methods in ASP.Net
I have been reading and reading the Microsoft best practices, articles on and on but still I can't figure out which method to chose to get started.... -
Aliased setter methods behave differently than other methods?
Here's another question... I am aliasing and redefining certain methods, determined at runtime. Normal methods work fine, but methods ending in '='... -
Hernan de Lahitte #2
Re: Illegal to mix Authentication methods ?
I think this article will shed some light on the subject.
[url]http://msdn.microsoft.com/asp.net/default.aspx?pull=/library/en-us/dnaspp/ht[/url]
ml/mixedsecurity.asp
"mklapp" <mklapp@zippy.com> escribió en el mensaje
news:05F96181-74C4-4175-A374-73F244AB80B2@microsoft.com...App and the WinForm Client use the same Web Service (or such is the plan).> Hello,
>
> I have a Web Service, a Winform client and a web Application. The WebWindows Authentication and works well.>
> The WinForm Client and the Webservice work together using Integrateddefault page redirects to the login page for the login. The login screen>
> The nature of the Web App, compels me to use Forms authentication. The
access the Web Service through the proxy generated by WSDL.exe.Login screen in the first place. After the login screen, access to the App>
> The intent is to only allow authenticated windows users to reach the
pages will be via cookie authentication. Each of the web pages access the
Web Service (through the proxy). Anonymous access is turned off. Where
authentication can be specified in the App path through IIS, it has been set
to Integrated Windows.FormsAuthentication.HashPasswordForStoringInConfig File(txtPss.Text, "sha1")>
> The code :
>
> Line 42: pss =<-----------The bad line> Line 43:
> Line 44: If proxy.ValidateUser(txtUser.Text, pss) ThenFormsAuthentication.RedirectFromLoginPage(txtUser. Text, False)>
> Line 45:System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(SoapClient> Line 46: Else
>
>
> The returned exception is below.
>
>
> WebException: The request failed with HTTP status 401: Access Denied.]
>
Message message, WebResponse response, Stream responseStream, Boolean
asyncCall)methodName, Object[] parameters)> System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(Stringc:\inetpub\wwwroot\3rdPartyWeb\login.aspx.vb:44> MABillingService.ValidateUser(String UserId, String psswd)
> _3rdPartyWeb.login.btnLogin_Click(Object sender, EventArgs e) inSystem.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePo> System.Web.UI.WebControls.Button.OnClick(EventArgs e)
>
stBackEvent(String eventArgument)sourceControl, String eventArgument)> System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandlerclient use Integrated Windows with a web service while another uses Forms> System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
> System.Web.UI.Page.ProcessRequestMain()
>
> Must I set authentication to Anonymous if I am using Forms? Can one
through the proxy for the same service?little of it is tied together.>
> I have read a lot, but everything is spread all over the place and>
Hernan de Lahitte Guest
-
Steven Cheng[MSFT] #3
RE: Illegal to mix Authentication methods ?
Hi Mklapp,
Thank you for posting in community. I'm reviewing this issue and found that
this thread seems a duplicated one with another one whose subject is:
"what loads proxies?"
in ASP.NET queue. I've replied you in that thread. Please check out my
suggestions there to see whether they'll be helpful. Also, I think the tech
article Hernan has provided is also very informative, you may have a look
at it.
If you feel anything unclear or if my suggestion there is not quite
suitable for you, please feel free to let me know.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! [url]www.microsoft.com/security[/url]
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Steven Cheng[MSFT] Guest
-
David Qiu #4
RE: Illegal to mix Authentication methods ?
When you access the Web service from the WinForm app, I expect you have set
the credential property on the proxy.
proxy.Credentials = myCache
[C#]
wReq.Credentials = CredentialCache.DefaultCredential;
[Visual Basic]
wReq.Credentials CredentialCache.DefaultCredential
I don't see you have done the same thing in the ASP.NET Web app. How do you
handle the authentication between ASPX and the Web service?
Are they on the same machine?
Thanks,
David
Microsoft Developer Support
David Qiu Guest
-
mklapp #5
RE: Illegal to mix Authentication methods ?
The authentication strategy here is an evolving thing. I am only configuring Authentication between the App and (I guess) IIS. The web service is for both internal use by a WinForm client and external use by a Web App. Authentication is implemented by both as a user login. This prevents unauthorized users from using the apps to access the Web Service. The nature of a web service, of course, let's any app negotiate the service through a published interface.
It is my intent not to publish the interface. Granted my intent may be frustrated by the nature of the beast. The same high level of abstraction that makes it possible to do so much so quickly, also could set up functionality I do not know about. The directory holding the web service is planned to disallow anonymous access. Beyond that the strategy will be determined by what is possible and necessary.
mklapp Guest
-
David Qiu #6
RE: Illegal to mix Authentication methods ?
When you access the Web service from the WinForm app, I expect you have set
the credential property on the proxy.
proxy.Credentials = myCache
[C#]
wReq.Credentials = CredentialCache.DefaultCredential;
[Visual Basic]
wReq.Credentials CredentialCache.DefaultCredential
I don't see you have done the same thing in the ASP.NET Web app. How do you
handle the authentication between ASPX and the Web service?
Are they on the same machine?
Thanks,
David
Microsoft Developer Support
David Qiu Guest
-
David Qiu #7
RE: Illegal to mix Authentication methods ?
I am sorry I don't quite understand your problem. What is the
authentication setting of the Web service in IIS? How do you invoke the Web
service method from the aspx page? The 401 error comes from IIS. Can you
use the same code to call the Web service from another aspx page that
doesn't use Form auth?
David
Microsoft Developer Support
Distributed Services
David Qiu Guest



Reply With Quote

