I have this security config that when a “resource” is accessed in my application Controller returns a Spring Login form:
<http auto-config="true" create-session="stateless" use-expressions="true">
<intercept-url pattern="/admin/*" access="hasRole('ROLE_ADMIN')"/>
<intercept-url pattern="/admin*" access="hasRole('ROLE_ADMIN')"/>
</http>
However, what I need is to return a JSON response and not a login from. When I try to set auto-config="false" I get this error:
No AuthenticationEntryPoint could be established.
What config do I need to set in my application so it will provide a JSON response instead of a login form.
Try this for default-target-url=”/url” specify on the controller @ResponseBody.