#Custom HTTP Response

1 messages · Page 1 of 1 (latest)

cursive sand
#

Hi, Does anyone know how to change the HTTP Response 403

little pagodaBOT
#

<@&1004656351647117403> please have a look, thanks.

little pagodaBOT
#

While you are waiting for getting help, here are some tips to improve your experience:

Code is much easier to read if posted with syntax highlighting and proper formatting.

If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.

Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.

cursive sand
#
        httpSecurity.csrf()
                .disable()//Enable later when understood CSRF
                .authorizeHttpRequests()
                .requestMatchers("/api/1.0/login")
                .permitAll()
                
little pagodaBOT
cursive sand
#

I have the following logic but when ever I call login and the credentials are invalid it returns 403 instead of 400 UNUATHORISED how can I customise this so I can return 400 instead of 403 as FORBIDDEN doesn't always make sense

little pagodaBOT
#

Closed the thread.

cursive sand
#

I fixed it 😛

#

.exceptionHandling().authenticationEntryPoint(new BasicAuthenticationEntryPoint())

viscid latch
#

hi again, you could also enable basic auth with defaults

#

http
// ...
.httpBasic(withDefaults());