I'm have a Spring service like this:
localhost:8889/projectX/insurance/?policy=1
@RestController
@RequestMapping(value="insurance")
public class InsuranceService {
@RequestMapping(value="/", method=RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public List<Policy> getPolicy(@RequestParam(value="policy") int policy){
...
}
}
That produces a JSON with a policy info.
In WebSecurityConfig.java i have this security:
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.antMatchers("/insurance/**").access("hasRole('advicer')")
...
So if I try to consume that service on SoapUI I will be directed to login form
How can I consume that service correctly with authentication?