How do you handle user registration and login in Spring Security?
Store users with hashed passwords, expose a validated registration endpoint, load them with UserDetailsService and enable form login in a SecurityFilterChain bean.
2,881 posts about Java: questions with answers, tutorials and articles, newest first.
Store users with hashed passwords, expose a validated registration endpoint, load them with UserDetailsService and enable form login in a SecurityFilterChain bean.
SecurityFilterChain is the bean that configures Spring Security for web requests. See how to define, order and extend chains, and how it replaced WebSecurityConfigurerAdapter.
Build a JwtService with jjwt 0.12, add a OncePerRequestFilter that authenticates bearer tokens, and configure a stateless Spring Security chain.
WebSecurityConfigurerAdapter was deprecated in Spring Security 5.7 and removed in 6.0. See what it did and how to migrate to SecurityFilterChain beans.
Configure Spring Security in Spring Boot 3 with a SecurityFilterChain bean, URL rules, password encoding, stateless API chains and method security.
Configure Spring Security 6 in Spring Boot with a SecurityFilterChain bean, role rules, hashed passwords, JWT validation and tests.
Spring Cloud Gateway has no @EnableGateway annotation. Add the starter and define routes in YAML or Java, with examples of predicates and filters.
Add the Spring Cloud Gateway starter, define routes with predicates and filters, then add load balancing, resilience and security at the edge.
@EnableEurekaClient registered an app with Eureka but is deprecated. Learn why it is no longer needed and how to set up a Eureka client with the starter.
They are focused entry points to Spring Cloud features such as discovery, configuration, gateways, Feign clients and circuit breakers, managed through one BOM.
Design independent Spring Boot services, connect them with REST clients and events, and add a gateway, resilience, observability and container deployment.
GraphQLError describes one error in a GraphQL response. See how to build it and map exceptions to it in Spring for GraphQL.
Map Java exceptions to GraphQL errors in Spring for GraphQL with @GraphQlExceptionHandler, error types, validation handling and safe defaults.
@MutationMapping connects a Spring controller method to a field of the GraphQL Mutation type. Learn the schema, arguments, validation, errors and security.
Define a Mutation type, write @MutationMapping controller methods with @Argument, and add validation and error handling using Spring for GraphQL.
@QueryMapping maps a field on the GraphQL Query type to a method in a Spring controller, so you can serve GraphQL queries without writing data fetchers.
The spring-boot-starter-graphql starter adds Spring for GraphQL and auto-configures a GraphQL endpoint driven by a schema file and annotated controllers.
Use Spring Data R2DBC or reactive MongoDB with ReactiveCrudRepository and a WebFlux controller to keep database access non-blocking from end to end.
Mono and Flux carry data through every Spring WebFlux layer. See controller, WebClient and streaming examples and the rules for using them.
Add spring-boot-starter-webflux and return Mono or Flux from a RestController. Covers a service layer, SSE streaming, error handling and WebTestClient tests.