B
B
Bashuk2013-02-05 19:16:57
In contact with
Bashuk, 2013-02-05 19:16:57

How to organize access to VK messages in a web application?

Lately I've become interested in web programming, in particular Web.Py + Twitter Bootstrap + Heroku. And just the other day I came across the VK API, and decided to do something cool.
There is an idea, but operations with personal VK messages appear in it. The problem is that the API functions for working with LANs are designed only for standalone applications (why?!). You can, of course, “pretend to be” a regular application, but this requires a username / password. But I want to do everything beautifully and politely, through authorization using OAuth.
How, after all, is it correct to organize such access so that the user enters the login / password on api.vkontakte.ru/ ..., but the web application eventually receives an access_token designed for a desktop application?
Thank you.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Alex Maslakov, 2013-02-05
@jMas

It is possible, but you need to:
1. Create an application in your personal VKontakte account, get a key
2. Using the key, ID and application key, as well as information about your page ID, login password, get an Access Token
3. Request VKontakte methods that satisfy obtained access rights using Access Token
I have a class implementation in PHP for the VKontakte API 2.0: pastebin.com/5yyCjASu
You can use it.

I
int03e, 2013-02-05
@int03e

No, that's the contact policy.

B
barker, 2013-02-05
@barker

I don't understand why standalone can't be done via OAuth? A year ago I wrote, everything was fine with that. No login-password is required, everything is the same through access_token.

A
ASiD, 2013-02-09
@ASiD

you can do it, but then you have to ask the user to copy the contents of the address bar (if you specify the data of the desktop application during authorization) and paste it into the field on the site. no other way

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question