Hi,
I have 5 pages in my website. I want to allow user to see some of the pages without login and two of pages see by the user only when he/she logged in.
How I use Authentication and Authorization for this task?
Plz reply
Hi,
I have 5 pages in my website. I want to allow user to see some of the pages without login and two of pages see by the user only when he/she logged in.
How I use Authentication and Authorization for this task?
Plz reply
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Gohil JayendrasinhRank #490 · 5K reputationPosted May 23, 2012, 10:11 PM EDT
HIHi
Forms authentication
A system by which unauthenticated requests
are redirected to an HTML form using HTTP client-side redirection. The user
provides credentials and submits the form. If the application authenticates the
request, the system issues a cookie that contains the credentials or a key for
reacquiring the identity. Subsequent requests are issued with the cookie in the
request headers; they are authenticated and authorized by an ASP.NET event
handler using whatever validation method the application developer specifies.
http://msdn.microsoft.com/en-us/library/9wff0kyh%28v=vs.71%29.aspx
·
Passport authentication
Centralized authentication service provided
by Microsoft that offers a single logon and core profile services for member
sites.
http://msdn.microsoft.com/en-us/library/f8e50t0f%28v=vs.71%29.aspx
· Windows authentication
ASP.NET uses Windows authentication in
conjunction with Microsoft Internet Information Services (IIS) authentication.
Authentication is performed by IIS in one of three ways: basic, digest, or
Integrated Windows Authentication. When IIS authentication is complete, ASP.NET
uses the authenticated identity to authorize access.
http://msdn.microsoft.com/en-us/library/907hb5w9%28v=vs.71%29.aspx
I think Formsauthentication is best for your requirement
http://www.c-sharpcorner.com/uploadfile/jayendra/how-to-create-formauthentication/
shih ho lin3 reputationPosted May 25, 2012, 1:15 AM EDT
Give you my example as attached file. Basically, I put secure pages in another folder with another web.config file, and deny anonymous users. On application's root config file, setting authentication mode to Forms authentication. Hope this may help you.