What are the most common methods of authentication?
Cookie-based
Token-based
Third-party (OAuth, API-token)
Also OpenID, Security Assertion Markup Language)
What is cookie-based authentiation?
Authentication users by storing details in browser cookies.
What is token-based authentication?
Server generates a token which is stored on client and sent with each request.
Commonly used for API’s
What is OAuth?
A user can sign in on one website and be authorised to perform actions on another.
What are the two OAuth Flows?
When is the Authorization Code Flow used?
Web application that can store a client secret
When is the Implicit Flow used?
Web application that can not store a client secret
Which Authentication Flow is more secure?
Authorisation
Describe the Authorisation Code Flow?
Describe the Implicit Code Flow?
What two main types of Authentication do you use in ASP.NET Core?
What is the main difference between Cookie and JWT authentication in ASP.NET?
How do you implement Cookie Authentication in ASP.NET?
In startup.cs ConfigureServices
services.AddAuthentication(…).AddCookie(…)
How do you implement JWT Authentication in ASP.NET?
In startup.cs ConfigureServices
services.AddAuthentication(…).AddJwtBearer(…)
Which validation parameters do you need to set with JWT Authentication?
How can you add a users Role to a Jwt?
Using Claim class
Create a list and add
new Claim(ClaimTypes.[Name/Role etc…], “Item”)