2

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

Marian
  • 387
  • 3
  • 17
  • I forgot to add, url where I'm redirected to login in vkontakt is fully unstyled. I say about http://oauth.vkontakte.ru/authorize?client_id=... – Marian Mar 20 '12 at 09:55

2 Answers2

2

It does not allow you to specify domain 'localhost'. It should be a kind of 'localhost.ua', 'www.mysite.com'. This has worked for me.

Evgen
  • 21
  • 2
2

I am contributor of this project and updated its wiki https://github.com/vkolodrevskiy/spring-social-vkontakte/wiki

vkolodrevskiy
  • 599
  • 3
  • 7
  • 18