Click here to Skip to main content
15,912,977 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to develop windows and form authentication together in single web application on the basis of following two condition
1) when external user come it automatically redirected to other page
2) when network member come he also automatically redirected to another page

plz help me if u have any example of this please upload here
Posted

MSDN[^]
Mixed Authentication[^]
Check these links.
I have used the same in one of my project. I have set the default url to a separate area Admin. And in IIS I have set the Admin Area folder as Windows Authentication, but the root folder will have Anonymous authentication. When the deault url hits that is the Admin area, then it asks for windows authentication, else if not valid then goes back to forms authentication in which you can use Authorize attribute by customizing it.
i hope you understand. Follow the links they will also help you out.
Post back your queries if any.
thanks.
 
Share this answer
 
Comments
Member 11270220 3-Dec-14 3:45am    
see what I want...if suppose user type www.yahoo.com site and he is authenticated user of yahoo.com network then he doesn't need authentication application directly move him to mail inbox of yahoomail.com he doesn't require username and password directly login into the system. and if outside network user type yahoo.com then he move to the yahoomail.com login page. I want to build that type of application
[no name] 3-Dec-14 4:22am    
Then here you need remember me functionality i think.
[no name] 3-Dec-14 4:26am    
else there is another way, if you want windows authentication, that is. In your table you need to store the username that will be unique and same as the Admin username for the system on which they are registered. Then on the default page you need to check if the username matches with
var userName = System.Threading.Thread.CurrentPrincipal.Identity.Name;
const string trim = "\\";
var name = userName.Split(Convert.ToChar(trim));
This will return the system admin username and then check the username exists in the database. If exists then allow him directly to the page you want to may be home page. else redirect to the login page.
I hope you get this.
Follow the steps below:

1. Maintain in database one bit field like IsAdUser (i.e. represent wheater it's active directory user or not.
2. Once user login check whether it's active directory user or not if it's active directory user then validate that user through LDAP, else validate against your database.

Please let me know if you need more clarity on this.
 
Share this answer
 
Comments
Member 11270220 18-Dec-14 6:30am    
need your help, I don't want to create database for company's Internal user who are in company domain. want login authentication form and windows mix mode authentication on single web application???

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900