Week 10 Part IV · Domain Logic and Security
Instructor lesson plan: lecture (2 h) and practice (2 h).
JWTauthorization policiesFluentValidationProblemDetails
| 0:00-0:20 | 20 min | Threats in ordinary APIsOver-posting, broken authorization, leaky errors, invalid state transitions. |
| 0:20-0:45 | 25 min | Authentication and JWTIdentity, tokens, validation, expiration, and where trust is established. |
| 0:45-1:10 | 25 min | Authorization policiesRoles, claims, requirements, handlers, and use-case-level checks. |
| 1:10-1:20 | 10 min | Break |
| 1:20-1:45 | 25 min | Validation and error contractsInput validation, domain validation, problem details, and consistent failures. |
| 1:45-2:00 | 15 min | Security review checklistWhat every team must show by final presentation. |
Students often think: authentication means the endpoint is secure.
Set it straight: authentication says who the caller is. Authorization decides what that caller may do.
| 0:00-0:25 | 25 min | Add authenticationConfigure token validation for the project API. |
| 0:25-0:55 | 30 min | Protect use casesAdd policies and executable authorization examples for at least two protected operations. |
| 0:55-1:10 | 15 min | Error shapeReturn consistent validation and domain error responses. |
| 1:10-1:20 | 10 min | Break |
| 1:20-1:50 | 30 min | Security reviewTeams review each other's endpoints for missing authorization. |
| 1:50-2:00 | 10 min | Project-integration briefDocument protected endpoints and validation strategy. |