why Spring Security Exception Translation Filter creates 403 Response Code for default configuration -
i pretty new spring security land. using programmatic configuration of spring security servletapi()
pretty neat.
here configuration:
@override protected void configure(httpsecurity http) throws exception { http .securitycontext().and() .servletapi().and() .authorizeurls() .antmatchers("/login").permitall() .antmatchers("/").permitall() .antmatchers("/**").authenticated(); }
i using http servlet api login not using filter this.
in case unauthorised request, exceptiontranslationfilter
uses http403entryforbiddenentrypoint
return 403 forbidden status.
in scenario:
- if user not authenticated, 401 status code should return.
- if user authenticated not authorised, 403 status code should return.
but default configuration creates 403 status both case.
here questions:
- why default entry point
http403entryforbiddenentrypoint
? can 401? - if change http
403
entryforbiddenentrypoint http401
entryforbiddenentrypoint, create problem?
thanks
Comments
Post a Comment