Access to this resource requires full authentication - calling the Rest Rest web service

My application is developed using spring framework. I created a new leisure web service using the spring framework.

@Controller
public class MyTestController {
   @Inject
    private MyService service;

    @RequestMapping(value = "/acc/Status/{accNum}", method = RequestMethod.GET)
    @ResponseBody
    public String getAccStatus(@PathVariable final String accNum, final HttpServletResponse response) throws Exception
        {
        //logic goes here
        return "success";
  }

MyService:

public interface BusinessCalendarService {

 //methods..
}

I want to see the answer of the above web service. I am using the postman tool to view responses. When I gave the request as http: // localhost: 8080 / myApplication / rest / acc / Status / 322298973 , it shows the following message.

HTTP Status 401 - Full authentication is required to access this resource

Existing controllers work fine, it is with my controller that the above message is displayed. Please suggest me to make any code changes? I went the same way as the other controllers.

+4

Source: https://habr.com/ru/post/1656388/


All Articles