I try to develop an application with connection to social set vkontakte. To do this I use spring-social-vkontakte module of spring-social from https:// github.com/vkolodrevskiy/spring-social-vkontakte as this resources is mentioned in official site spring social http:// www.springsource.org/spring-social.
Problem is that when I use VKontakteConnectionFactory to make request to my application in vkontakte I can't use my local address in redirect_uri because I receive na error:
{"error":"invalid_request","error_description":"redirect_uri has wrong domain, check application settings"}
in vkontakte documentation http://vk.com/developers.php?oid=-17680044&p=Authorizing_Client_Applications in section how to build authorization url is described: "REDIRECT_URI – the address to which access_token will be rendered". To resole this problem I use http:// api.vkontakte.ru/blank.html as redirect_uri, I can receive an code but after authorization I can't back to my application. It is a problem. My example:
VKontakteConnectionFactory vKontakteConnectionFactory = new VKontakteConnectionFactory(app_id, app_secret);
OAuth2Operations operations = vKontakteConnectionFactory.getOAuthOperations();
OAuth2Parameters parameters = new OAuth2Parameters();
parameters.setRedirectUri("http://api.vkontakte.ru/blank.html");
String authorazeUrl = operations.buildAuthorizeUrl(GrantType.AUTHORIZATION_CODE, parameters);
response.sendRedirect(authorazeUrl);
In vkontakte I have created on application with next parameter:
- Site address: http://localhost:8080/
- Base domain: localhost (in this place I can't type localhost:8080, service denies it)
I destroyed some links because I can't post so many(
If somebody knows how to do redirection to localhost or some other solution how to solve this problem, please help me.
Thanks in advance