Click to See Complete Forum and Search --> : secured authentication in asp.net


karthik_balus
March 20th, 2006, 06:38 AM
hai every body...

Im a student from india...

I want to provide user authentication in my webapplicaation... Such that only authorized users can get into that application...

I have writtern coding for this...
But this has an issue...

When i cut and paste the address in browser means it is getting opened... and also back and front keys are working...
I wanna rectify this...

I need full fledged security in my application... Such that when we copy and paster the address of the webform means it should not open...

Please help me out in this....

regards
karthik

HairyMonkeyMan
March 20th, 2006, 06:57 AM
What are you doing when a user logs on? setting session variables / creating cookies?

You could write a little class (or user control) that checks the session variables / cookies, and if not found, redirect to an 'access denied' page, then just import this into every page.

Shouldn't be too hard

karthik_balus
March 20th, 2006, 07:36 AM
Can u please give me the coding for that access-denied page.... Its urgent for me.. I need to complete my project today... Tell me the correct procedure to redirect to acess denied page...

HairyMonkeyMan
March 20th, 2006, 08:05 AM
Tell me the correct procedure to redirect to acess denied page...

Only because I am feeling sorry for ya, and have been in your situation myself.. You can save yourself this stress by managing your time a little better.

When your user logs in successfully, set a session variable called UserOk = True. Then you can either add this sub into each page and call it from the Form_Load i.e
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
CheckUser()
End If
End Sub

Sub CheckUser()
Dim IsUserOk as Object = session("UserOK")
If (IsUserOk is Nothing) OR (IsUserOk = False) Then
Response.Redirect("accessdenied.htm")
End If
End Sub

or a better way is to have this in a class...

good luck

karthik_balus
March 20th, 2006, 08:31 AM
Thank u very much for your timely help... I will check it out and let u know....

Once again thanks...

regards
karthik