Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Answers

1.Authentication is the process of identifying and validating a user’s credentials. It is a process that verifies the authenticity of a user. After a user is authenticated, the process called authorization checks to see what resources this authenticated user can have access to.

In ASP.NET, you can use one of the following types of authentication:

  • Forms authentication

  • Windows authentication

  • Passport authentication

2.You can enable forms authentication in your application’s web.config file by specifying the authentication mode attribute, as shown in the following code snippet:
<configuration>
  <system.web>
    <authentication mode="Forms"/>
    <forms name="loginForm" loginUrl="loginForm.aspx" />
    <authorization>
        <deny users="?"/>
    </authorization>
  </system.web>
</configuration>

3.The AuthenticationService class allows you to access the ASP.NET authentication service using a client-side script. This class is comprised of two methods: login and logout. Whereas the login method allows you to validate the user’s credentials, the logout method clears the forms authentication cookie in order to log the user out.
4.You can enable authentication service as shown in the following code snippet:
<system.web.extensions>
  <scripting>
    <webServices>
      <authenticationService enabled="true" />
    </webServices>
  </scripting>
</system.web.extensions>

Note that you should enable forms authentication for your application before using authentication service.

 


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint