spring-projects / spring-security-samples

1.46k stars 711 forks source link

Make `/error` public for samples #298

Open sjohnr opened 3 months ago

sjohnr commented 3 months 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.