Skip to content
Advertisement

Tag: spring-security-rest

Spring security exception handling custom response

How is it possible to return a json instead a html? I got: i need something like this: My Adapter: The CustomAuthenticationEntryPoint Answer Pragmatically we can print/write to response[.getWriter()] within our entry point, like: BasicAuthenticationEntryPoint@github Then we can pass a test like: To make it work for basic authetication and “wrong credentials” see also: https://stackoverflow.com/a/74547059/592355 . Dup/Related: How to set

Why is remember-me a lesser authentication then full-authentication in spring-security?

This is a conceptual question about the fact, that authentication has different grades in spring security. There is a grade for anonymous authentication also called IS_AUTHENTICATED_ANONYMOUSLY and remember me authentication IS_AUTHENTICATED_REMEMBERED the full authentication, when a user just provided his entire credentials and got confirmed aka IS_AUTHENTICATED_FULLY In the implementation of AuthenticatedVoter#isFullyAuthenticated it is clear, that a full authenticated user

Advertisement