C
Chad Yoshikawa
I have a WebService that is using FormsAuthentication (setup in the
web.config file) as follows:
<authentication mode="Forms">
<forms name=".ASPXAUTH" loginUrl="https://foo.com/Register/Login.aspx"
protection="All" timeout="30" path="/" />
</authentication>
Accessing the web service via a browser is fine, because the user can
access the login page (which has a username/password form on it).
I want to be able to access the WebService using a WindowsApplication as
well. I'd like to use the same FormsAuthentication if possible. The
question I have, is how to go about doing this? My best guess is: I
would need to POST the username and password to the Login page, get back
the Cookie (a FormsAuthenticationTicket), and then add this cookie to
the WebService.CookiesContainer.
Does this sound right? Any suggestions would be much appreciated.
Thank you,
-Chad
web.config file) as follows:
<authentication mode="Forms">
<forms name=".ASPXAUTH" loginUrl="https://foo.com/Register/Login.aspx"
protection="All" timeout="30" path="/" />
</authentication>
Accessing the web service via a browser is fine, because the user can
access the login page (which has a username/password form on it).
I want to be able to access the WebService using a WindowsApplication as
well. I'd like to use the same FormsAuthentication if possible. The
question I have, is how to go about doing this? My best guess is: I
would need to POST the username and password to the Login page, get back
the Cookie (a FormsAuthenticationTicket), and then add this cookie to
the WebService.CookiesContainer.
Does this sound right? Any suggestions would be much appreciated.
Thank you,
-Chad