spring-projects / spring-security-samples

1.4k stars 685 forks source link

Make `/error` public for samples #298

Open sjohnr opened 1 month ago

sjohnr commented 1 month ago

Current behavior:

Some samples (for example, the servlet/spring-boot/java/oauth2/webclient sample) are attempting to show a Spring Boot error page in certain scenarios, but instead show the login page when the user is not authenticated.

Expected behavior:

When the user is not authenticated and an error occurs (for example, calling a resource server causes a 401 Unauthorized response due to a missing access token), the error page should be shown.