Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to mix ASP.NET Forms and Windows authentication

How to mix ASP.NET Forms and Windows authentication

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netsysadminwindows-adminsecurity
9 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Moonark
    wrote on last edited by
    #1

    I am developing a web application that uses Forms authentication however it has a few web service methods so that I can script some maintenance tasks and allow other administrative functions. Is there an easy way to change a sub folder to use Windows authentication instead of Forms without multiple web applications or web.config files. I tried to override it using the option but am getting "configuration section not allowed to be set below application." when looking in IIS. Any thoughts on how to use both methods without deploying a separate app?

    The network is down...let's go get bagels.

    J J J 3 Replies Last reply
    0
    • M Moonark

      I am developing a web application that uses Forms authentication however it has a few web service methods so that I can script some maintenance tasks and allow other administrative functions. Is there an easy way to change a sub folder to use Windows authentication instead of Forms without multiple web applications or web.config files. I tried to override it using the option but am getting "configuration section not allowed to be set below application." when looking in IIS. Any thoughts on how to use both methods without deploying a separate app?

      The network is down...let's go get bagels.

      J Offline
      J Offline
      jkirkerx
      wrote on last edited by
      #2

      I think you can use multiple web.config files,in a web app. Just make a new one and drop it in the folder. The web.config will work on all sub folders beneath that folder.

      1 Reply Last reply
      0
      • M Moonark

        I am developing a web application that uses Forms authentication however it has a few web service methods so that I can script some maintenance tasks and allow other administrative functions. Is there an easy way to change a sub folder to use Windows authentication instead of Forms without multiple web applications or web.config files. I tried to override it using the option but am getting "configuration section not allowed to be set below application." when looking in IIS. Any thoughts on how to use both methods without deploying a separate app?

        The network is down...let's go get bagels.

        J Offline
        J Offline
        Jorgen Andersson
        wrote on last edited by
        #3

        If you don't want to add extra web.config files in the subfolder, you can add a <location> section in your main web.config.

        Light moves faster than sound. That is why some people appear bright, until you hear them speak. List of common misconceptions

        M 1 Reply Last reply
        0
        • J Jorgen Andersson

          If you don't want to add extra web.config files in the subfolder, you can add a <location> section in your main web.config.

          Light moves faster than sound. That is why some people appear bright, until you hear them speak. List of common misconceptions

          M Offline
          M Offline
          Moonark
          wrote on last edited by
          #4

          Is there perhaps a machine or web.config setting that could be preventing it? IIS throws up errors when I am using the tag.

          The network is down...let's go get bagels.

          J 1 Reply Last reply
          0
          • M Moonark

            Is there perhaps a machine or web.config setting that could be preventing it? IIS throws up errors when I am using the tag.

            The network is down...let's go get bagels.

            J Offline
            J Offline
            Jorgen Andersson
            wrote on last edited by
            #5

            What's the error messages?

            Light moves faster than sound. That is why some people appear bright, until you hear them speak. List of common misconceptions

            1 Reply Last reply
            0
            • M Moonark

              I am developing a web application that uses Forms authentication however it has a few web service methods so that I can script some maintenance tasks and allow other administrative functions. Is there an easy way to change a sub folder to use Windows authentication instead of Forms without multiple web applications or web.config files. I tried to override it using the option but am getting "configuration section not allowed to be set below application." when looking in IIS. Any thoughts on how to use both methods without deploying a separate app?

              The network is down...let's go get bagels.

              J Offline
              J Offline
              Joshua Omundson
              wrote on last edited by
              #6

              You cannot mix the two authentication methods. You can only use one authentication method per site, so you have to pick either Forms or Windows. The only thing you can do with a sub folder is change the authorization, which is something separate.

              J 1 Reply Last reply
              0
              • J Joshua Omundson

                You cannot mix the two authentication methods. You can only use one authentication method per site, so you have to pick either Forms or Windows. The only thing you can do with a sub folder is change the authorization, which is something separate.

                J Offline
                J Offline
                Jorgen Andersson
                wrote on last edited by
                #7

                There is atleast one workaround[^].

                Light moves faster than sound. That is why some people appear bright, until you hear them speak. List of common misconceptions

                J 1 Reply Last reply
                0
                • J Jorgen Andersson

                  There is atleast one workaround[^].

                  Light moves faster than sound. That is why some people appear bright, until you hear them speak. List of common misconceptions

                  J Offline
                  J Offline
                  Joshua Omundson
                  wrote on last edited by
                  #8

                  I agree that the OP might be able to impliment this to work with their application, but my point is still valid. As the article states "While you might like to just combine Forms and Windows authentication, its not that easy. Each ASP.NET application can only have one authentication type, so you need to pick just one."

                  J 1 Reply Last reply
                  0
                  • J Joshua Omundson

                    I agree that the OP might be able to impliment this to work with their application, but my point is still valid. As the article states "While you might like to just combine Forms and Windows authentication, its not that easy. Each ASP.NET application can only have one authentication type, so you need to pick just one."

                    J Offline
                    J Offline
                    Jorgen Andersson
                    wrote on last edited by
                    #9

                    Agreed.

                    Light moves faster than sound. That is why some people appear bright, until you hear them speak. List of common misconceptions

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups