473,327 Members | 1,979 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,327 software developers and data experts.

Detecting authentication mode

Hi everyone

I have a small app that can run with both forms and windows authentication
(depending on what is set in web.config).

I'd like to know from code which of the authentication modes was set in
web.config, is this possible?

I tried using WindowsPrincipal.AuthenticationMode, but it always gives
"NTLM" regardless of what is set in web.config (that's because IIS detects
and authenticates the windows user, if it can do it, i bet).

Thanx in advance

ASC
Nov 18 '05 #1
2 1021
Try using Context.User.Identity.AuthenticationType instead.

Michael Earls

"Strange Cat" <st*****@cat.com> wrote in message
news:oS*********************@news3.tin.it...
Hi everyone

I have a small app that can run with both forms and windows authentication
(depending on what is set in web.config).

I'd like to know from code which of the authentication modes was set in
web.config, is this possible?

I tried using WindowsPrincipal.AuthenticationMode, but it always gives
"NTLM" regardless of what is set in web.config (that's because IIS detects
and authenticates the windows user, if it can do it, i bet).

Thanx in advance

ASC

Nov 18 '05 #2
> Try using Context.User.Identity.AuthenticationType instead.
[CUT]

Thanx Michael, works ok!

Bye

ASC
Nov 18 '05 #3

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...
1
by: MJ | last post by:
I'm building an application that has a file structure similar to the following: /myapp/user_login.aspx /myapp/user_page_1.aspx /myapp/user_page_2.aspx /myapp/user_page_3.aspx...
4
by: Jay | last post by:
I have authentication set for my site but I need one page to be an exception case. Namely my forgot password page. How do I tell the webconfig file to authenciate all pages except one page? ...
3
by: Kris van der Mast | last post by:
Hi, I've created a little site for my sports club. In the root folder there are pages that are viewable by every anonymous user but at a certain subfolder my administration pages should be...
4
by: Paul M | last post by:
hi there, i've got a website i created, that i've put onto my test server on the web. I have a login page, that when the user comes to it, it first pops up a windows authentication dialog box,...
9
by: Bijoy Naick | last post by:
I've implemented forms authentication and authorization on my application. In my Web.Config, my authorization section looks like this.. <authorization> <allow roles="admin" /> <deny users="*"...
1
by: Joe | last post by:
What I want to do is make only one page require a login. The application itself works fine. I'm getting the following error: Parser Error Message: It is an error to use a section registered as...
3
by: Adam J Knight | last post by:
Hi all, I have an app that mostly requires authentication. However there are a couple of pages that don't require authentication.. What do i need in my web.config, to specify these pages...
6
by: Eng.Rana | last post by:
Hello All, i was wondering what is the main difference between the windows authentication and mixed mode authentication?? according to security recommendations, we should enable windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.