No authentication with Server.Transfer("url")

Discussion in 'ASP .Net Security' started by Ashok, Oct 24, 2006.

  1. Ashok

    Ashok Guest

    Hi All,

    I am using Integrated windows authentication(IWA) on my child virtual
    directory(VD) which is beneath the parent Virtual Directory. When i use
    Server.Transfer("/Parent VD/Child VD/StartingPage.aspx")
    i am getting the error "Error executing child request for
    /Parent VD/Child VD/StartingPage.aspx." (NO Login Box gets prompted).
    I have anonymous access for the Parent VD (as this is for public access) and
    Integrated windows authentication for the Child VD.
    If i use the full url like
    Response.Redirect("http://IPAddress//Parent VD/Child
    VD/StartingPage.aspx,true)
    it prompts the windows login box.

    I created both parent and child VD'S as Applications when i got the below
    error
    (I configure both virtual directory's (VD's) as applications)

    "it is an error to use a section registered as
    allowDefinition='MachineToApplication' beyond application level. This error
    can be caused by a virtual directory not being configured as an application
    in IIS."


    Below are my machine.config settings
    <section name="authorization"
    type="System.Web.Configuration.AuthorizationConfigHandler, System.Web,
    Version=1.0.5000.0, Culture=neutral, PublicKeyToken=somekey"/>
    <section name="authentication"
    type="System.Web.Configuration.AuthenticationConfigHandler, System.Web,
    Version=1.0.5000.0, Culture=neutral, PublicKeyToken=somekey"
    allowDefinition="MachineToApplication"/>
    <section name="machineKey"
    type="System.Web.Configuration.MachineKeyConfigHandler, System.Web,
    Version=1.0.5000.0, Culture=neutral, PublicKeyToken=somekey"
    allowDefinition="MachineToApplication"/>
    <!-- /security -->
    <section name="sessionState"
    type="System.Web.SessionState.SessionStateSectionHandler, System.Web,
    Version=1.0.5000.0, Culture=neutral, PublicKeyToken=somekey"
    allowDefinition="MachineToApplication"/>


    integrated windows authentication (IW Authentication)

    wwwroot
    -----Parent Virtual Directory (ANONYMOUS ACCESS ==> IW Authentication)
    ---- Child Virtual Directory (integrated windows
    authentication)


    I greatly appreciate your help.

    Thank You
    Ashok, Oct 24, 2006
    #1
    1. Advertising

  2. Ashok

    Ashok Guest

    I think i found the solution from the below site

    http://www.velocityreviews.com/forums/t92722-servertransfer-scope.html

    Well the reason could be as you mentioned, Server.transfer is application
    level scope. When you do Server.Transfer, I guess asp.net executes the
    target webform and returns the result to the browser. In .NET each
    application is run under its own application domain. I think Server.Transfer
    is restricted to application level scope, because one application domain can
    not access the code of another application domain.Where as
    Response.Redirect, involves two round trips, the second one does a HTTP Get
    request. So, you can do Response.Redirect without any restrictions


    To user Server.Transfer create the child folder as Directory not Virtual
    Directory and then control the folder and permissions using the help given in
    this link.

    http://www.expertrating.com/courseware/DotNetCourse/DotNet-ASP.Net-12-1.asp

    .......

    Please correct me if i am wrong




    "Ashok" wrote:

    > Hi All,
    >
    > I am using Integrated windows authentication(IWA) on my child virtual
    > directory(VD) which is beneath the parent Virtual Directory. When i use
    > Server.Transfer("/Parent VD/Child VD/StartingPage.aspx")
    > i am getting the error "Error executing child request for
    > /Parent VD/Child VD/StartingPage.aspx." (NO Login Box gets prompted).
    > I have anonymous access for the Parent VD (as this is for public access) and
    > Integrated windows authentication for the Child VD.
    > If i use the full url like
    > Response.Redirect("http://IPAddress//Parent VD/Child
    > VD/StartingPage.aspx,true)
    > it prompts the windows login box.
    >
    > I created both parent and child VD'S as Applications when i got the below
    > error
    > (I configure both virtual directory's (VD's) as applications)
    >
    > "it is an error to use a section registered as
    > allowDefinition='MachineToApplication' beyond application level. This error
    > can be caused by a virtual directory not being configured as an application
    > in IIS."
    >
    >
    > Below are my machine.config settings
    > <section name="authorization"
    > type="System.Web.Configuration.AuthorizationConfigHandler, System.Web,
    > Version=1.0.5000.0, Culture=neutral, PublicKeyToken=somekey"/>
    > <section name="authentication"
    > type="System.Web.Configuration.AuthenticationConfigHandler, System.Web,
    > Version=1.0.5000.0, Culture=neutral, PublicKeyToken=somekey"
    > allowDefinition="MachineToApplication"/>
    > <section name="machineKey"
    > type="System.Web.Configuration.MachineKeyConfigHandler, System.Web,
    > Version=1.0.5000.0, Culture=neutral, PublicKeyToken=somekey"
    > allowDefinition="MachineToApplication"/>
    > <!-- /security -->
    > <section name="sessionState"
    > type="System.Web.SessionState.SessionStateSectionHandler, System.Web,
    > Version=1.0.5000.0, Culture=neutral, PublicKeyToken=somekey"
    > allowDefinition="MachineToApplication"/>
    >
    >
    > integrated windows authentication (IW Authentication)
    >
    > wwwroot
    > -----Parent Virtual Directory (ANONYMOUS ACCESS ==> IW Authentication)
    > ---- Child Virtual Directory (integrated windows
    > authentication)
    >
    >
    > I greatly appreciate your help.
    >
    > Thank You
    Ashok, Oct 24, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andrew Connell
    Replies:
    1
    Views:
    537
    Natty Gur
    Oct 21, 2003
  2. Shankar kalel
    Replies:
    1
    Views:
    458
    Joerg Jooss
    Dec 30, 2003
  3. Shankar Kalel
    Replies:
    0
    Views:
    298
    Shankar Kalel
    Dec 30, 2003
  4. Alvin Bruney [MVP]

    Re: Server.Transfer URL

    Alvin Bruney [MVP], Mar 2, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    878
    Eric Lawrence [MSFT]
    Mar 2, 2004
  5. Jim
    Replies:
    1
    Views:
    849
    Aaron Bertrand - MVP
    Jan 28, 2004
Loading...

Share This Page