Click here to Skip to main content
13,096,268 members (52,170 online)
Click here to Skip to main content
Articles » Web Development » ASP.NET » General » Downloads

Stats

53K views
3.3K downloads
43 bookmarked
Posted 9 Oct 2011

Bypass Forms Authentication to Use Active Directory User Authentication in ASP.NET

, 9 Oct 2011
This article describes how to keep form based and active directory user based authentication process in parallel in ASP.NET.
using System;
using System.Configuration;

namespace ActiveDirectoryAuthentication.Helper
{
    public class ActiveDirectoryConfiguration : ConfigurationSection
    {
        [ConfigurationProperty("enabled", DefaultValue = "true", IsRequired = true)]
        public Boolean Enabled
        {
            get
            {
                return (Boolean)this["enabled"];
            }
            set
            {
                this["enabled"] = value;
            }
        }

        [ConfigurationProperty("server", DefaultValue = "", IsRequired = true)]
        public string Server
        {
            get
            {
                return this["server"].ToString();
            }

            set
            {
                this["server"] = value;
            }
        }

        [ConfigurationProperty("domain", DefaultValue = "", IsRequired = true)]
        public string Domain
        {
            get
            {
                return this["domain"].ToString();
            }

            set
            {
                this["domain"] = value;
            }
        }

        [ConfigurationProperty("directoryPath", DefaultValue = "", IsRequired = true)]
        public string DirectoryPath
        {
            get
            {
                return this["directoryPath"].ToString();
            }

            set
            {
                this["directoryPath"] = value;
            }
        }

        [ConfigurationProperty("groupName", DefaultValue = "", IsRequired = true)]
        public string GroupName
        {
            get
            {
                return this["groupName"].ToString();
            }

            set
            {
                this["groupName"] = value;
            }
        }

        [ConfigurationProperty("filter", DefaultValue = "", IsRequired = true)]
        public string Filter
        {
            get
            {
                return this["filter"].ToString();
            }

            set
            {
                this["filter"] = value;
            }
        }

        [ConfigurationProperty("filterReplace", DefaultValue = "", IsRequired = true)]
        public string FilterReplace
        {
            get
            {
                return this["filterReplace"].ToString();
            }

            set
            {
                this["filterReplace"] = value;
            }
        }

        [ConfigurationProperty("pageLevelSecurityCheck", DefaultValue = "false", IsRequired = true)]
        public Boolean PageLevelSecurityCheck
        {
            get
            {
                return (Boolean)this["pageLevelSecurityCheck"];
            }
            set
            {
                this["pageLevelSecurityCheck"] = value;
            }
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Fazlur Rahman
Technical Lead Ominto Inc
United Arab Emirates United Arab Emirates
I am Bachelor in CSE from Khulna University of Engineering & Technology,Bangladesh. I have more than 11 years experience in software design & development, data analysis & modeling, project management and currently working in a software company in Dubai,UAE as a Lead Software Engineer. I am MCAD(Microsoft Certified Application Developer) certified since 2005. Please feel free to contact with me at nill_akash_7@yahoo.com.


You may also be interested in...

Pro
Pro
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.170813.1 | Last Updated 9 Oct 2011
Article Copyright 2011 by Fazlur Rahman
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid