⬆️ ⬇️

Authorization module via VKontakte for Kohana

After the opening of the VKontakte API, several articles appeared immediately on how to create a quick authorization on your user site vk.com , incl. and in PHP . I decided to start writing an authorization module for Kohana .



The API documentation is very frail, I had to study the ds-durov.at js-scripts and transfer some functionality to PHP (sending a POST request with getting full information about the user, instead of an ajax implementation for durov.at ). The most difficult place turned out to be the generation of a unique request signature (as they explain, “the request signature by the standard scheme”), since this process is not normally described.



Module Vk can log in and receive information about the user and, accordingly, log out. The information is stored in the cookie and in the session. If desired, you can add everything to the database, request additional information about the user, etc.

')

Detailed description on the module page in github. Do not forget to create your VKontakte application for testing and write the received API ID, application key and protected key in config/vk.php , as well as create the xd_receiver.htm file following the example in the description.

Source: https://habr.com/ru/post/93727/



All Articles