Subjects

All subjects Django Java Python React Spring Boot JavaScript PHP
Sign Up Free
Spring Boot 10 questions

Spring Security (Authentication & Authorization)

Secure Spring apps. Learn security filter chains, custom user details, JWT authentications, OAuth2, and password encoding.

More Spring Boot
Interview questions 1–10 of 10
1

What is Spring Security and how does the filter chain work?

Spring Security is a framework that provides authentication, authorization, and protection against common atta...

Read answer →
2

What is the difference between authentication and authorization in Spring Security?

Authentication answers "who are you?" — verifying a user's identity through credentials such as a username/pas...

Read answer →
3

How do you implement JWT authentication in Spring Boot?

JWT (JSON Web Token) authentication is stateless: after a user logs in with credentials, the server generates...

Read answer →
4

How does OAuth2 login work in Spring Boot (Spring Security OAuth2 Client)?

Spring Security's OAuth2 Client support lets an application delegate authentication to an external identity pr...

Read answer →
5

How does password encoding work in Spring Security (BCryptPasswordEncoder)?

Spring Security never stores or compares plain-text passwords. A PasswordEncoder bean, typically BCryptPasswor...

Read answer →
6

How do you implement method-level security with @PreAuthorize and @PostAuthorize?

Method-level security lets you enforce authorization rules directly on service or controller methods instead o...

Read answer →
7

What is CSRF protection and when should it be disabled in Spring Boot?

CSRF (Cross-Site Request Forgery) protection prevents a malicious site from tricking an authenticated user's b...

Read answer →
8

How do you configure CORS in Spring Boot?

CORS (Cross-Origin Resource Sharing) is a browser security mechanism that blocks a web page from calling an AP...

Read answer →
9

What is the difference between a Custom UserDetailsService and using in-memory authentication?

In-memory authentication defines a fixed set of users, passwords, and roles directly in configuration using In...

Read answer →
10

What is Spring Security's SecurityContext and how is it propagated?

The SecurityContext holds the current Authentication object, representing the currently authenticated user, th...

Read answer →