Spring Boot

OAuth2 และ Authorization Server

OAuth2 และ Authorization Server, flow (authorization code, client credentials), resource server, scopes

20 คำถามสัมภาษณ์·
Senior
1

OAuth2 คืออะไร?

คำตอบ

OAuth2 เป็นโปรโตคอลการอนุญาต (authorization) ที่ช่วยให้แอปพลิเคชันของบุคคลที่สามได้รับสิทธิ์เข้าถึงบริการ HTTP แบบจำกัดในนามของผู้ใช้ โดยไม่ต้องเปิดเผย credentials ของผู้ใช้ มันทำงานผ่าน access token แทนที่จะใช้รหัสผ่าน OAuth2 ถูกใช้อย่างแพร่หลายสำหรับการยืนยันตัวตนแบบมอบหมาย (เข้าสู่ระบบผ่าน Google, GitHub ฯลฯ) และ REST API ที่ปลอดภัย

2

OAuth2 flow ใดปลอดภัยที่สุดสำหรับเว็บแอปพลิเคชัน?

คำตอบ

Authorization Code flow เป็น flow ที่ปลอดภัยที่สุดเพราะ access token ไม่เคยถูกเปิดเผยต่อเบราว์เซอร์ แอปพลิเคชัน backend จะแลกเปลี่ยน authorization code ชั่วคราวเป็น access token ผ่านช่องทางที่ปลอดภัย (backend-to-backend) ด้วย PKCE (Proof Key for Code Exchange) flow นี้จะปลอดภัยยิ่งขึ้นต่อการโจมตีแบบ interception

3

ควรใช้ Client Credentials flow ในกรณีใด?

คำตอบ

Client Credentials flow ออกแบบมาสำหรับการสื่อสารแบบ machine-to-machine (service-to-service) โดยไม่มีบริบทของผู้ใช้ แอปพลิเคชัน client จะยืนยันตัวตนโดยตรงด้วย credentials ของตนเอง (client_id และ client_secret) เพื่อรับ access token ใช้สำหรับ batch job, microservice หรือ backend API ที่ทำงานในนามของตนเอง

4

PKCE (Proof Key for Code Exchange) ใน OAuth2 คืออะไร?

5

ทำไม Implicit flow จึงถูกเลิกใช้ (deprecated) ใน OAuth2?

+17 คำถามสัมภาษณ์

หัวข้อสัมภาษณ์ Spring Boot อื่นๆ

Spring Core - IoC & DI

Junior
22 คำถาม

Spring Boot Auto-Configuration

Junior
20 คำถาม

Spring Boot Starters

Junior
18 คำถาม

Application Properties & YAML

Junior
16 คำถาม

การทำ Logging ด้วย SLF4J และ Logback

Junior
20 คำถาม

Spring Boot DevTools

Junior
15 คำถาม

Spring MVC Basics

Mid-Level
20 คำถาม

Spring REST Controllers

Mid-Level
20 คำถาม

Request & Response Handling

Mid-Level
20 คำถาม

การจัดการข้อยกเว้น

Mid-Level
25 คำถาม

Bean Validation

Mid-Level
25 คำถาม

พื้นฐาน Spring Data JPA

Mid-Level
25 คำถาม

เอนทิตี JPA และความสัมพันธ์

Mid-Level
30 คำถาม

การสืบค้น JPA

Mid-Level
30 คำถาม

Spring Data Repositories

Mid-Level
25 คำถาม

พื้นฐาน Spring Security

Mid-Level
25 คำถาม

Spring Boot Actuator

Mid-Level
20 คำถาม

การทดสอบหน่วยด้วย JUnit และ Mockito

Mid-Level
30 คำถาม

การทดสอบ Spring Boot

Mid-Level
30 คำถาม

Profiles และ Environment

Mid-Level
20 คำถาม

RestTemplate และ WebClient

Mid-Level
24 คำถาม

Async และ Scheduling

Mid-Level
25 คำถาม

Caching ด้วย Spring

Mid-Level
25 คำถาม

Spring WebFlux (Reactive)

Mid-Level
25 คำถาม

ทรานแซกชัน Spring

Senior
30 คำถาม

การยืนยันตัวตนและการให้สิทธิ์ขั้นสูง

Senior
30 คำถาม

JWT และความปลอดภัยแบบ Stateless

Senior
20 คำถาม

Spring Boot และ Docker

Senior
19 คำถาม

Microservices ด้วย Spring

Senior
25 คำถาม

Spring Cloud Config

Senior
19 คำถาม

การเพิ่มประสิทธิภาพการทำงาน

Senior
30 คำถาม

GraalVM Native Images

Senior
20 คำถาม

เชี่ยวชาญ Spring Boot สำหรับการสัมภาษณ์ครั้งถัดไป

เข้าถึงคำถามทั้งหมด flashcards แบบทดสอบเทคนิค แบบฝึกหัด code review และตัวจำลองสัมภาษณ์

เริ่มใช้ฟรี