Simple authentication without roles
-
Hi.. I m working on a web application where I have simple structure. I have root directory and a secure directory. root directory have pages which all users can request, and secure directory will be accessible to users who are authenticated. ( I dont need roles as i will have only one type of users).. can you tell me how to proceed for authentication.. thanks,
By: Hemant Thaker
-
Hi.. I m working on a web application where I have simple structure. I have root directory and a secure directory. root directory have pages which all users can request, and secure directory will be accessible to users who are authenticated. ( I dont need roles as i will have only one type of users).. can you tell me how to proceed for authentication.. thanks,
By: Hemant Thaker
There are several different ways to accomplish this; what have you tried so far? If your users have to log in you should be able to create some logic which tests for that and redirects or allows through as appropriate. How are you managing the users?
me, me, me "The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!" Larry Niven nils illegitimus carborundum
-
There are several different ways to accomplish this; what have you tried so far? If your users have to log in you should be able to create some logic which tests for that and redirects or allows through as appropriate. How are you managing the users?
me, me, me "The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!" Larry Niven nils illegitimus carborundum
Hi.. thanks, I am storing users in database. only username and pwd. Once user is logged in certain links will appear ( links for secured pages). so I want , only valid users can request these pages.. I simply want to stop someone directly using Urls in address bar for these secured pages.. thanks,
By: Hemant Thaker
-
Hi.. thanks, I am storing users in database. only username and pwd. Once user is logged in certain links will appear ( links for secured pages). so I want , only valid users can request these pages.. I simply want to stop someone directly using Urls in address bar for these secured pages.. thanks,
By: Hemant Thaker
One way would be to create an attribute that would test to see if the current user is logged in/valid. If not, then redirect to another page. You would create the attribute and then decorate the page class; see the tutorial or fond one more suitable. Attributes Tutorial[^] This is just one way and it may not be the best for you (or anyone, for that matter). Do some more research and see what else you can come up with on your own, try it and then come back when you get really stuck.
me, me, me "The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!" Larry Niven nils illegitimus carborundum
-
One way would be to create an attribute that would test to see if the current user is logged in/valid. If not, then redirect to another page. You would create the attribute and then decorate the page class; see the tutorial or fond one more suitable. Attributes Tutorial[^] This is just one way and it may not be the best for you (or anyone, for that matter). Do some more research and see what else you can come up with on your own, try it and then come back when you get really stuck.
me, me, me "The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!" Larry Niven nils illegitimus carborundum
Hi. I am storing username to a session["userid"] variable, once the user logged in. How about checking the session value on the page_load of all secured pages. and if dont find the value redirect to "custom_page" thanks
By: Hemant Thaker
-
Hi. I am storing username to a session["userid"] variable, once the user logged in. How about checking the session value on the page_load of all secured pages. and if dont find the value redirect to "custom_page" thanks
By: Hemant Thaker
if (Session["userid"] != null)
{
//rediect to desired page
}
else
{
//rediect to custom page
}Raju.M
-
Hi. I am storing username to a session["userid"] variable, once the user logged in. How about checking the session value on the page_load of all secured pages. and if dont find the value redirect to "custom_page" thanks
By: Hemant Thaker
Let an attribute do that for you - that's what they are there for! Read the docs and i should get you started.
me, me, me "The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!" Larry Niven nils illegitimus carborundum