I am trying to provide the security of the rest API using spring custom Authentication manager. Now the problem when I am trying to access the url through postman its is showing Access Denied Exception because user is anonymous. Now my requirement is every request for accessing that API should go to custom Security Manager. I have my own logic to validate. I will validate the request is valid or not depending on the Input json parameter. My config xml showing below.
<security:http use-expressions="true">
<security:intercept-url pattern="/persons" access="isAuthenticated()"/>
<security:csrf disabled="true"/>
<security:http-basic/>
</security:http>
<security:authentication-manager alias="authenticationManager">
<security:authentication-provider ref="customAuthenticationManager" />
</security:authentication-manager>