Войти
  • 1075Просмотров
  • 1 год назадОпубликованоCodersee- Kotlin on the backend

Authorization in Ktor. RBAC with custom plugin

In this video, we're gonna learn not only how to secure Ktor REST API with RBAC (role-based access control), but also, how to implement a custom request-scoped plugin the easy way using hooks. ✅repo we start with: ✅postman collection: === CHECK THIS OUT === 🔥My Ultimate Kotlin Course - 🔥Never miss any Kotlin news with my free newsletter: ====================== === LEARN EVERYWHERE === 🔹 🔹 @pjoterwolak 🔹 🔹 🔹 🔹 🔹 ========================== === BEST BOOKS FOR KOTLIN DEVS === 📗Clean Code 📗The Clean Coder 📗Clean Architecture 📗Kotlin In Action 📗Kotlin Design Patterns and Best Practices ======================== === 00:00 Introduction 00:42 What exactly we will do? 01:25 What is RBAC / role-based access control? 02:17 Update User class and repo 04:00 Add 'role' claim to JWT tokens 05:26 Update UserService 06:42 What are Ktor plugins? 07:26 Implement Ktor RBAC plugin 13:48 Add RoleUtil 15:11 Update user routes 16:27 Testing & summary ===