Windows authentication with login form
I want to create a program that will prompt a user for a windows user name and password that authenticates against active directory. Once authenticated I want them to only be able to access particular forms based on their group permissions in active directory. For instance once logged in if they are in the Telnet group they can access the telnet portion of the program if not then they get a generic error telling them to contact their system administrator. They way I see it working is that when they log in it also checks to see what groups they are in and stores it as a variable. Each form that they then access checks that variable and if that group is not listed then the user will not have access to that portion of the program.
Thanks for any and all help.
Swapnil PalandePosted Jul 27, 2006, 5:53 AM
There are more than one way to this.
Following one of the simple method:
1) In your Login table where you are storing user name and password, add one more column 'Group'. After this add the group name of the user in newly created column 'Group'.
2) Now add new form (lets say 'Main.vb' form) to the project, where you will add links to the various forms in project.
3) Create stored procedure that will check the validity of user and returns the group of that particular user.
4) When user inserts user name and password and clicks submit button, stored procedure will check whether the user name and password is exists or not. And if it is exists it will return the group of that particular user.
5) Now on newly created form (i.e. Main.vb) check the group of the user (which is return by the stored procedure) and accordingly give links for the forms which are accessible by this particular group.
I hope you got it.
Regards,
Swapnil.