MVC - Graded Quiz

15. What is Forms Authentication in ASP.NET?

  • It is a mechanism to authenticate users using biometric data.
  • It is a mechanism to authenticate users using social media accounts.
  • It is a mechanism to authenticate users using credentials stored in a database.
  • It is a mechanism to authenticate users using OAuth 2.0 tokens.

16. Which attribute is used to enable Forms Authentication in ASP.NET?

  • forms
  • authentication
  • authorization
  • membership

17. Which configuration file is used to configure Forms Authentication in ASP.NET?

  • appsettings.json
  • web.config
  • launchSettings.json
  • program.cs

18. What is the purpose of the "AllowAnonymous" attribute in ASP.NET?

  • It allows anonymous users to access protected resources.
  • It requires users to provide additional credentials for access.
  • It blocks access to resources for all users.
  • It disables authentication for a specific action or controller.

19. What is the purpose of the "FormsAuthenticationTicket" class in ASP.NET?

  • It is used to encrypt and decrypt user credentials.
  • It is used to store user credentials in a secure manner.
  • It is used to create an authentication ticket for a user after successful authentication.
  • It is used to validate user credentials against a database.

20. What is the purpose of Forms Authentication in ASP.NET?

  • To encrypt sensitive data in web forms.
  • To authenticate and authorize users for accessing resources in a web application.
  • To create and manage user accounts in a web application.
  • To prevent cross-site scripting (XSS) attacks in a web application.

21. Which of the following is a standard security protocol used for secure communication over the internet?

  • FTP
  • SMTP
  • SSL/TLS
  • HTTP

22. What is Cross-Site Scripting (XSS) attack?

  • An attack where the attacker intercepts and modifies data between two parties.
  • An attack where the attacker gains access to a user’s password.
  • An attack where the attacker injects malicious scripts into a web page viewed by other users.
  • An attack where the attacker gains access to a user’s computer by exploiting a vulnerability in a software application.

23. What is the purpose of the Anti-Forgery Token in ASP.NET?

  • To prevent cross-site scripting (XSS) attacks.
  • To encrypt sensitive data in web forms.
  • To prevent Cross-Site Request Forgery (CSRF) attacks.
  • To authenticate and authorize users for accessing resources in a web application.

24. What is the purpose of the "Authorize" attribute in ASP.NET Core?

  • To encrypt sensitive data in web forms.
  • To define the URL path for a specific route in an ASP.NET Core application.
  • To restrict access to a controller or action method to authenticated users.
  • To define the HTTP method to use for a controller action method in an ASP.NET Core application.

Leave a Reply