473,378 Members | 1,407 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Read Authentication Type From Web.Config

Hi-

I am using ASP.NET 2.0. I would like to have a generic function in my
application that will determine what type of authentication to use and
then proceed with authentication, either Windows or Forms.

How do I read the authentication type from Web.Config?

Thanks in advance,

Renae
hi*******@yahoo.com

Nov 19 '05 #1
5 1691
You are defining the type in the web.config... so checking from there seems
kind of a waste.... or am I missing something?

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"hi*******@yahoo.com" wrote:
Hi-

I am using ASP.NET 2.0. I would like to have a generic function in my
application that will determine what type of authentication to use and
then proceed with authentication, either Windows or Forms.

How do I read the authentication type from Web.Config?

Thanks in advance,

Renae
hi*******@yahoo.com

Nov 19 '05 #2
I have a page object that I'm including the code to perform the Windows
authentication. If the authentication mode is set to forms in the
web.config, I don't want to execute this code. I would like the page
object to be able to be used for either authentication mode. Something
like this maybe:

if (authentication_mode == "Windows")
{
.....
}

Is there a way to tell in the application what kind of authentication
was used?

Thanks,
Renae

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Nov 19 '05 #3
Pat
But what is your application doing?
Or what is it going to do.
Patrick

"Renae" <hi*******@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I have a page object that I'm including the code to perform the Windows
authentication. If the authentication mode is set to forms in the
web.config, I don't want to execute this code. I would like the page
object to be able to be used for either authentication mode. Something
like this maybe:

if (authentication_mode == "Windows")
{
....
}

Is there a way to tell in the application what kind of authentication
was used?

Thanks,
Renae

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com

Nov 19 '05 #4

Configuration config = WebConfigurationManager.OpenWebConfiguration("~");
SystemWebSectionGroup grp = (SystemWebSectionGroup)config.GetSectionGroup("sys tem.web");
AuthenticationSection auth = grp.Authentication;
if (auth.Mode == AuthenticationMode.Forms)
{
}
else if (auth.Mode == AuthenticationMode.Windows)
{
}
-Brock
DevelopMentor
http://staff.develop.com/ballen
Hi-

I am using ASP.NET 2.0. I would like to have a generic function in my
application that will determine what type of authentication to use and
then proceed with authentication, either Windows or Forms.

How do I read the authentication type from Web.Config?

Thanks in advance,

Renae
hi*******@yahoo.com


Nov 19 '05 #5
Pat
Brock if its ASP.NET 1.1
Could this be done?
Patrick

"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message
news:11***********************@msnews.microsoft.co m...

Configuration config = WebConfigurationManager.OpenWebConfiguration("~"); SystemWebSectionGroup grp = (SystemWebSectionGroup)config.GetSectionGroup("sys tem.web"); AuthenticationSection auth = grp.Authentication;
if (auth.Mode == AuthenticationMode.Forms)
{
}
else if (auth.Mode == AuthenticationMode.Windows)
{
}
-Brock
DevelopMentor
http://staff.develop.com/ballen
Hi-

I am using ASP.NET 2.0. I would like to have a generic function in my
application that will determine what type of authentication to use and
then proceed with authentication, either Windows or Forms.

How do I read the authentication type from Web.Config?

Thanks in advance,

Renae
hi*******@yahoo.com


Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Billy Jacobs | last post by:
I have a website which has both secure and non-secure pages. I want to uses forms authentication. How do I accomplish this? Originally I had my web.config file in the root with Forms...
4
by: js | last post by:
I am building a intranet site that has public and private information that are rendered by ASP.Net pages. The site is not partitioned into private/public folders. When users hit the site's URL,...
11
by: xenophon | last post by:
I have a web site with forms authentication and a single logon page. I have 4 subdirectories, each that should be protected by a different username/password combination. For testing purposes, the...
6
by: Billy Jacobs | last post by:
I have a website which has both secure and non-secure pages. I want to uses forms authentication. How do I accomplish this? Originally I had my web.config file in the root with Forms...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.