.NET

Authentication & Authorization

JWT tokens, cookie authentication, Identity, authorization policies, claims, role-based access

18 gespreksvragen·
Mid-Level
1

What is a JWT (JSON Web Token)?

Antwoord

JWT is a self-contained token that encodes authentication information as digitally signed JSON. It consists of three parts separated by dots: header (algorithm), payload (data/claims), and signature (verification). Unlike server sessions, JWT is stateless and enables distributed authentication without server-side storage.

2

What is the fundamental difference between authentication and authorization?

Antwoord

Authentication verifies user identity (who is he), while authorization determines permissions (what can he do). Authentication is always the first step, followed by authorization. For example, logging in with a password is authentication, then checking if the user can access an admin resource is authorization.

3

How does cookie authentication work in ASP.NET Core?

Antwoord

The server generates an encrypted cookie after credential validation, automatically stored by the browser. This cookie contains user claims and is automatically sent with each request. The server decrypts the cookie to identify the user without database query. Suitable for traditional web applications with server-side navigation.

4

What is the typical JWT authentication workflow in an API?

5

What is a claim in the authentication context?

+15 gespreksvragen

Beheers .NET voor je volgende gesprek

Krijg toegang tot alle vragen, flashcards, technische tests, code review-oefeningen en gespreksimulatoren.

Begin gratis