When I try to get access_token when accessing the VK API, it throws me at the link http: // localhost: 8080 / vk / login # access_token = token & expires_in = 86400 & user_id = id and it is correct, but only the login method in the vk controller returns a response that the access_token input parameter no. but here it is.

HTTP Status 400 - Required String parameter 'access_token' is not present

@RequestMapping(value = "/login", method = RequestMethod.GET) @ApiOperation(value = "login into vk", httpMethod = "GET") public String login (@RequestParam("access_token") String code) throws IOException { System.out.print(code); vkService.getUserCode(); return null; } 

/ vk is on the controller.

  • What is your redirect_uri , also with this # symbol? if so, delete it. - MrFylypenko

1 answer 1

You do not pass the parameter. Replace # with ? in url-e. Spring controller does not read hash param, it can be done only on the client-side, on the server side it does not work. https://stackoverflow.com/questions/20508075/get-hash-parameters-in-request-url-in-spring-controller