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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
shih ho linPosted May 25, 2012, 5:15 AM
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.
Gohil JayendrasinhPosted May 24, 2012, 2:11 AM
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/