Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default Re: HTTPWebRequest

    Well, here's the scenario:

    In your base app, the user's credentials are verified. If the rest of those
    apps "hang under" the base app, then you could write another cookie just
    before the FormsAuth.RedirectFromLoginPage in your base app that writes this
    cookie indicating proper auth.

    Now, in your child apps, the login page could check to see if this special
    "auth" cookie is already present, and perform what I call a "Soft Login,"
    whereas upon login's load, it makes a check, then calls the
    FormsAuth.RedirectFromLogin using the "master cookie's" contents.

    Obviously if you dont properly encrypt this "master cookie" then security is
    blown, since a hacker could easily craft a this cookie to gain "soft login"
    priveledges to all the base apps, this being, only AFTER he found out that
    the base cookie even exists

    In summary,
    - login to base app, create a "master cookie" for soft logins to child apps
    - child apps' login pages check for "master cookie" and perform soft login
    if true

    This would only work if you set the cookie's path to be "/" or whatever the
    base app's path is.


    --
    Eric Newton
    [email]eric@ensoft-software.com[/email]
    C#/ASP.net Solutions developer

    "Anthony Leuzzi" <AvantiJunk@comcast.net> wrote in message
    news:utBLvVyYDHA.1744@TK2MSFTNGP12.phx.gbl...
    > I currently have a ASP website which requires a user to provide a user
    name
    > a password. There is a section of the page will lists all of the ASP.NET
    > applications the user has access to. These web sites will be secured
    > through forms authentication.
    >
    > I am trying to figure out a way to authenticate the user with having them
    to
    > log in again. I was thinking that I could manually post the user name and
    > password to the login page for that application and I have had some
    success
    > using the HTTPWebRequest. However, I can get the click event of the login
    > button to fire. I know I need to indicate that the login button caused
    the
    > postback, but I haven't figured out a way to do that.
    >
    > Is there another way to have a single signon for multiple websites?
    >
    > Thanks in advance.
    > Anthony
    >
    >
    >

    Eric Newton Guest

  2. Similar Questions and Discussions

    1. httpwebrequest please help clarify
      I am posting an xml document using httpwebrequest post method using a x509certificate, my question is this, is this secure if I am posting to an...
    2. HttpWebRequest and HttpWebResponse
      Hi all: My old application used to POST xml to a remote server using HttpWebRequest from within an aspx page. The process worked like a charm...
    3. HttpWebRequest and 401
      Hello All Here is what I am attempting to do: I have a NTLM protected site. There are some users who are not part of the domain (visitors) get...
    4. How to authenticate HttpWebRequest?
      Hi, i have a protected part of application ("security" subdirectory is protected by authentication mode="Forms"). i'd like to give a user a...
    5. HttpWebRequest is not posting
      Hi All, I have an HttpWebRequest object that is supposed to post data to a web page. The server is receiving the data, and I am getting an OK...
  3. #2

    Default HttpWebRequest

    i need to read about 100 diffrent html pages from my site,
    every 1 hour,
    i do it with HttpWebRequest and HttpWebResponse and wth
    full success,
    the problem is that every time i call HttpWebRequest.Create
    () method it open a new session in my site (i can see it
    in the statistic page), i want to do that with only one
    session.
    is it possible?

    nissim Guest

  4. #3

    Default Re: HttpWebRequest

    You need to use a CookieContainer instance shared by all the requests, I
    guess.

    Paolo Pialorsi [ DevLeap - Bridge The Gap! ]
    Blog: [url]http://blogs.devleap.com/paolo.blog[/url]

    "nissim" <nis_krigh@hotmail.com> wrote in message
    news:038e01c3d0ad$2645e3e0$a001280a@phx.gbl...
    > i need to read about 100 diffrent html pages from my site,
    > every 1 hour,
    > i do it with HttpWebRequest and HttpWebResponse and wth
    > full success,
    > the problem is that every time i call HttpWebRequest.Create
    > () method it open a new session in my site (i can see it
    > in the statistic page), i want to do that with only one
    > session.
    > is it possible?
    >

    Paolo Pialorsi [DevLeap] Guest

  5. #4

    Default Re: HttpWebRequest

    Thanks
    But i to do that, where i can find a code sample?
    thanks again

    >-----Original Message-----
    >You need to use a CookieContainer instance shared by all
    the requests, I
    >guess.
    >
    >Paolo Pialorsi [ DevLeap - Bridge The Gap! ]
    >Blog: [url]http://blogs.devleap.com/paolo.blog[/url]
    >
    >"nissim" <nis_krigh@hotmail.com> wrote in message
    >news:038e01c3d0ad$2645e3e0$a001280a@phx.gbl...
    >> i need to read about 100 diffrent html pages from my
    site,
    >> every 1 hour,
    >> i do it with HttpWebRequest and HttpWebResponse and wth
    >> full success,
    >> the problem is that every time i call
    HttpWebRequest.Create
    >> () method it open a new session in my site (i can see it
    >> in the statistic page), i want to do that with only one
    >> session.
    >> is it possible?
    >>
    >
    >
    >.
    >
    Nissim Guest

  6. #5

    Default Re: HttpWebRequest

    [url]http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemNetHttpWebRequestClassCookieContainerTo pic.asp[/url]

    May be your problem is different. Try to send more details...

    Paolo Pialorsi [ DevLeap - Bridge The Gap! ]
    Blog: [url]http://blogs.devleap.com/paolo.blog[/url]

    "Nissim" <nis_krigh@hotmail.com> wrote in message
    news:05ba01c3d1e4$65b5fc80$a601280a@phx.gbl...
    > Thanks
    > But i to do that, where i can find a code sample?
    > thanks again
    >
    >
    > >-----Original Message-----
    > >You need to use a CookieContainer instance shared by all
    > the requests, I
    > >guess.
    > >
    > >Paolo Pialorsi [ DevLeap - Bridge The Gap! ]
    > >Blog: [url]http://blogs.devleap.com/paolo.blog[/url]
    > >
    > >"nissim" <nis_krigh@hotmail.com> wrote in message
    > >news:038e01c3d0ad$2645e3e0$a001280a@phx.gbl...
    > >> i need to read about 100 diffrent html pages from my
    > site,
    > >> every 1 hour,
    > >> i do it with HttpWebRequest and HttpWebResponse and wth
    > >> full success,
    > >> the problem is that every time i call
    > HttpWebRequest.Create
    > >> () method it open a new session in my site (i can see it
    > >> in the statistic page), i want to do that with only one
    > >> session.
    > >> is it possible?
    > >>
    > >
    > >
    > >.
    > >

    Paolo Pialorsi [DevLeap] Guest

  7. #6

    Default HttpWebRequest

    Thanks again ...
    i'm sorry, May be my problem was not explained properly.
    i need to read from console app several HTML content.
    i know how to do that with HttpWebRequest and
    HttpWebResponse , and its work .
    the problem is that every page i read is a new session in
    the web server.
    i want to read all the 100 html pages in only one session.
    is that possible?
    Thanks
    Nissim
    Nissim Guest

  8. #7

    Default Re: HttpWebRequest



    Nissim wrote:

    > i need to read from console app several HTML content.
    > i know how to do that with HttpWebRequest and
    > HttpWebResponse , and its work .
    > the problem is that every page i read is a new session in
    > the web server.
    > i want to read all the 100 html pages in only one session.
    > is that possible?
    I think the answers you have already got suggest that you need to use
    the CookieContainer of the first HttpWebResponse with all following
    HttpWebRequests. Have you tried that?
    Usually a web server application keeps track of sessions by sending out
    a cookie with the session id and the client sends that sesssion id
    cookie back. Thus if you use the CookieContainer containing the session
    id cookie the server sends back on the first request then all your
    following requests should be in the same session.

    --

    Martin Honnen
    [url]http://JavaScript.FAQTs.com/[/url]

    Martin Honnen Guest

  9. #8

    Default Re: HttpWebRequest

    What exactly do you mean by "Session" ? Do you mean application sessions
    (implemented using cookies for example) or TCP connection sessions ?

    If former, use CookieContainer as the other posters have suggested.

    If latter, you should be using KeepAlive=true on the webrequest ( which is
    the default). One of the reasons that you are not seeing this default
    behavior could be that you are using Windows Integrated Authentication on
    the server. Is that the case ?

    feroze.

    --
    Remove "user" from the email address to reply to the author.

    This posting is provided "AS IS" with no warranties, and confers no rights

    Use of included script samples are subject to the terms specified at
    [url]http://www.microsoft.com/info/cpyright.htm[/url]




    "Martin Honnen" <Martin.Honnen@t-online.de> wrote in message
    news:#74nfYr0DHA.1336@TK2MSFTNGP12.phx.gbl...
    >
    >
    > Nissim wrote:
    >
    >
    > > i need to read from console app several HTML content.
    > > i know how to do that with HttpWebRequest and
    > > HttpWebResponse , and its work .
    > > the problem is that every page i read is a new session in
    > > the web server.
    > > i want to read all the 100 html pages in only one session.
    > > is that possible?
    >
    > I think the answers you have already got suggest that you need to use
    > the CookieContainer of the first HttpWebResponse with all following
    > HttpWebRequests. Have you tried that?
    > Usually a web server application keeps track of sessions by sending out
    > a cookie with the session id and the client sends that sesssion id
    > cookie back. Thus if you use the CookieContainer containing the session
    > id cookie the server sends back on the first request then all your
    > following requests should be in the same session.
    >
    > --
    >
    > Martin Honnen
    > [url]http://JavaScript.FAQTs.com/[/url]
    >

    Feroze [MSFT] Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139