Ask a Question related to ASP.NET Security, Design and Development.
-
buran #1
webclient object and forms authentication
How do I download file from the web when the site uses forms authentication?
Without the authentication, webclient object works.
Thanks,
Buran
buran Guest
-
Accessing htm files without authentication (forms authentication)
I have application with forms authentication. All works fine. When user opens .aspx file gets login form, login and then get the .aspx page. But... -
ASP.Net Forms authentication with basic authentication popup
Relatively new to ASP.Net but have a strange problem. My site uses forms authentication for a large administration section however after the user... -
Forms authentication then redirection to a secure web with NT authentication?
Hi, I want to allow access to particular secured intranet web sites. These intranet are stored in sharepoint (2003 version) Actually I've... -
Authentication ticket, cookieless, forms authentication?
Hi. I want to use Forms Authentication, cookieless. The issue is setting the Authentication Ticket without using cookies (!) That is, the... -
webclient object and downloading output file from an intranet site
Dear ASP.NET Programmers, I have an intranet site (web applicaton) with the login page http://burak/database/login.aspx. The site implements... -
John Saunders #2
Re: webclient object and forms authentication
"buran" <buran@buran.com> wrote in message
news:eihAvdfeDHA.4024@TK2MSFTNGP11.phx.gbl...authentication?> How do I download file from the web when the site uses formsYou have to log in, same as a user would.> Without the authentication, webclient object works.
--
John Saunders
Internet Engineer
[email]john.saunders@surfcontrol.com[/email]
John Saunders Guest
-
buran #3
Re: webclient object and forms authentication
How can I login using WebClient or WebRequest object? Could you please give
sample code?
Thakn you
"John Saunders" <john.saunders@surfcontrol.com> wrote in message
news:#JGg2vieDHA.1820@TK2MSFTNGP10.phx.gbl...> "buran" <buran@buran.com> wrote in message
> news:eihAvdfeDHA.4024@TK2MSFTNGP11.phx.gbl...> authentication?> > How do I download file from the web when the site uses forms>> > Without the authentication, webclient object works.
> You have to log in, same as a user would.
> --
> John Saunders
> Internet Engineer
> [email]john.saunders@surfcontrol.com[/email]
>
>
buran Guest
-
John Saunders #4
Re: webclient object and forms authentication
"buran" <buran@buran.com> wrote in message
news:ewuaQV4eDHA.1828@TK2MSFTNGP10.phx.gbl...give> How can I login using WebClient or WebRequest object? Could you pleaseNot really. The only code I have which does this is embedded in a complex> sample code?
asynchronous program.
The idea is that you need to POST the username and password just like the
browser does. You will find that a downside is that the browser sends
name/value pairs, where the name is the name of the control to which the
value applies, like username=john. An issue is that in ASP.NET, the name is
likely to be something compound, like _ctl0:_ctl1:username. The numbering of
the _ctln names is likely to change over time as the form is maintained, so
your code will either have to change when the login page changes, or else
try to guess what the names are by looking at the form.
FYI, the way a login sequence usually works in Forms Authentication is:
1. Client requests: GET desiredPage.aspx
2. Server responds with a "302 Page moved" response, giving the location of
the login page:
3. Client requests the login page with a GET
4. Server responds with the login page, which includes the form fields
you'll need to fill in
5. Client sends the username/password with a POST to the login page
6. Server responds with a "302 Page moved" response, giving the location of
desiredPage.aspx and also a login cookie
7. Client requests desiredPage.aspx with a GET, including the login cookie,
and this time it succeeds
I hope this helps, and I'm sorry my code wouldn't help you much.
--
John Saunders
Internet Engineer
[email]john.saunders@surfcontrol.com[/email]
John Saunders Guest



Reply With Quote

