Book 4 - ServerSide Flashcards
What is a controller?
a controller is a class. A controller class contains methods that are the handlers for the endpoints of the API. Controllers inherit many of their properties and methods from the ControllerBase class. A controller contains all of the endpoints for a specific resource.
what does decorated mean?
decorated is when a specific annotation or attribute is applied to a class, method, property or field to provide additional information or behavior.
[Route(“api/[controller]”)]
Route attribute, tells the framework what route segment should be associated with all of the endpoints in the controller.
[ApiController]
attribute for controllers
What is ControllerBase
parent class for the controllers
What is Authentication?
proving you are you who say you are
What is Authorization?
proving you are allowed to do what you are trying to do
What is a cookie?
A small piece of data that a web server sends to a web browser, which the browser then stores locally. They are used to track user activity, maintain user sessions, store user preferences, and perform other tasks related to user interaction with a website or web application.
What is in a cookie?
it is possible to configure lots of data in a cookie… each piece is called a claim
IdentityDbContext
class inherited from EF Core
IdentityUser
part of IdentityDbContext - this will hold login credentials for users
IdentityRole
part of IdentityDbContext - this will hold the various roles that a user can have
IdentityUserRole
part of IdentityDbContext - a many-to-many table between roles and users. These define which users have which roles.
what is a Guid
Global Unique Identifier. These can be created with Guid.NewGuid()..a Guid is a data type … used for uniquely identified resources
what does hashing a password mean ?
hashing the password has to do with obscuring the password for security reasons.