Question

I'm using asp.net mvc 4 where I need to access to vkontakte api. Does anybody know how to do this by code in C#? I need to send next url string:

https://oauth.vk.com/authorize? 
client_id=APP_ID& 
 scope=PERMISSIONS& 
 redirect_uri=REDIRECT_URI& 
 response_type=code& 
 v=API_VERSION 

I dont know what I should to insert into redirect_uri and how can I get response_type?

Link with documentaion where I nothing to understand: http://vk.com/dev/auth_sites

Was it helpful?

Solution

Here's a tutorial. Check it for implementing OAuth for Vkontakpe API

Реализация oAuth-регистрации в проектах ASP.NET MVC 4 на примере ВКонтакте

UPD:

More info.

OAuth + ASP.NET (Часть 3): авторизация через vkontakte по протоколу OAuth 2.0

vk-oauth.cs

VkClient.cs

UPD 2:

Here you can find permission's list. You should put them in scope variable. Example:

scope=friends,video,offline 

Vk API Permissions

UPD 3:

REDIRECT_URI – адрес, на который будет передан code. Этот адрес должен находиться в пределах домена, указанного в настройках приложения. Обратите внимание, в адресе должен содержаться используемый протокол.

So it means that, redirect is the uri of callback method, that should get response from Vk Api.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top