0

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>
kaushik
  • 312
  • 1
  • 7
  • Possible duplicate of [Custom Authentication Manager with Spring Security and Java Configuration](http://stackoverflow.com/questions/31826233/custom-authentication-manager-with-spring-security-and-java-configuration) – Issam El-atif Oct 25 '16 at 09:05
  • @IssamELATIF It is not the same question.. – kaushik Oct 25 '16 at 09:32
  • Gets your customAuthenticationManager invoked when you send the request with Postman?, what is the result of your customAuthenticationManager? do you send the basic auth information with postman? – Ralph Oct 25 '16 at 10:04

0 Answers0