Natural Programmer's Blog

Topics on Spring Framework for developing elegant real-world applications

Reactive Spring Security For WebFlux REST Web Services - A Complete Blueprint

In this series of posts, we'll dive into how exactly to configure Spring Security for reactive and stateless WebFlux REST APIs. Specifically, we'll look at how to: Have Spring Security pick users from our user table, rather than its default in-memory user-store. Support form-login to obtain a...

READ MORE

Exception Handling And Validation In Spring Boot WebFlux Reactive REST API

In a previous series, we discussed a real-world pattern for exception handling and validation in Spring Boot & MVC REST Web Services. Please go through first if you have not. To summarize, we recommended coding an ErrorComposer to compose errors from exception objects, which could be used in...

READ MORE

Using Nimbus JOSE + JWT in Spring Applications — Why and How

JWTs could be very useful in RESTful Web Services — not only for stateless authentication, but for all the purposes that require tokens — e.g. email verification and forgot-password. In this post, we'll discuss why and how to use the Nimbus JOSE + JWT library for creating and parsing JWT (JWE)...

READ MORE

Supporting Multi-Form Request Data In Spring RESTful Web Services

In this post, we'll discuss how to receive data in a REST end-point in multiple formats. Say you have an endpoint for adding customers, as below: POST /customers There could be two types of customers, INDIVIDUAL and ORGANIZATION. For individuals, the body would have the following format: { ...

READ MORE

Using Postman REST Client Cleverly - Some Quick Tips

Postman is one of the most popular API development environments, which needs no introduction to API developers. But strangely, numerous API developers often ignore many of its key features and make their work unnecessarily difficult. In this post, we'll discuss such key features that every API...

READ MORE

Spring Security 5 OAuth 2.0 Login and Signup in stateless RESTful Web Services

This post has moved to DZone.

READ MORE

How to get the current user in a Spring Security reactive (WebFlux) and non-reactive (MVC) application

When developing an application, we sometimes need to access the currently logged in user programmatically. In this post, we’ll discuss how to do that when using Spring Security — both in non-reactive (Spring MVC) as well as reactive (Spring WebFlux) applications. The code snippets are derived...

READ MORE

Spring Framework 5: What’s New For A Common Developer

Spring Framework 5 is coming – with many shiny features – including a new reactive framework. You can find the list of new features at many places in the Internet. Here is a good post on it. So, I gave a closer look to figure out what’s in it for my students. Most of the grand features doesn’t...

READ MORE

Writing Readable Code With Java 8 Method References

Java 8 lambda expressions make our code concise and readable. However, it’s the method references, along with the static and default methods in functional interfaces, which makes our code shine. Let’s take an example. Suppose we have an array of names that we want to sort. The array looks like...

READ MORE

Exception Handling in Spring Boot REST Web Services - a real-world pattern - part II

This article has moved to https://www.naturalprogrammer.com/courses/332639/lectures/5397747.

READ MORE