Quantcast
Channel: Security
Viewing all articles
Browse latest Browse all 4737

Allow users to access other site pages if not user ID is not in sql database

$
0
0

Hello,

I created a .net application with a sql backend for all of its user authentication. My application users header variables to retrieve the users ID and username and I want to know how to do the following:1. If username/ID is in the database then user is redirected to their desired page

2. If username/ID is NOT in the database then they are redirected to a 'not authorized' page

The user upon going to the main site page see all the options like you would any other page but should only be able to access the rest of the site if they have the correct permissions. I know if you have a login page then you must alter the web.config file with something like the following:

<authorization> <deny users="?" /><allow users="*" /></authorization>

But I do not have a login page, I just want to check the users against my sql database and if they are in it they have access and can access the rest of the web site.

Any resources on how to do this would be greatly appreciated.


Viewing all articles
Browse latest Browse all 4737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>