N
N
Nikita Gusakov2014-02-27 17:34:43
symfony
Nikita Gusakov, 2014-02-27 17:34:43

How to implement registration in a site on Symfony via VK?

There is a project on symphony, the bulk of users will log in via VK-oauth. But these users need to be stored not only in the session, but also in the database, in order to be able to distribute bans / add to groups, etc. In general, in addition to VKid, you need an internal ID in the application for each user.
While writing the main part, I used FOSUserBundle, now I searched, found https://github.com/hwi/HWIOAuthBundle, after long attempts to set it up, it became clear that the bundle makes it possible to create a "key box", that is, authorization via vk, but not registration.
In general, perhaps someone faced such a task, or simply wrote their own simple bundle with users for the symphony, so that you could just get into it and add the necessary functionality.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
N
Nikita Gusakov, 2014-08-10
@hell0w0rd

Figured it out, wrote a post nkt.me/2014/08/10/configure-symfony-oauth

S
shagguboy, 2014-02-27
@shagguboy

What is the difference between authorization and registration? vk_id can be obtained. other data too.

G
GHua, 2014-02-27
@GHua

Yes, you can register through it. Unfortunately, I can't watch right now.
I remember just after connect, the user was redirected to the simplified registration page and there, by clicking confirmation, he already received the user in the database with id => vk_id.
Almost everything was done using HWIOAuthBundle. Their dock is lame, yes.
If there is no decision by the evening, I can see how I did it there.

A
artoodetoo, 2014-03-05
@artoodetoo

https://gist.github.com/danvbe/4476697
after I tried this example, I found that registration is possible in my assemblies, even without custom classes.
the behavior of the application after the associated account is NOT found depends on the configuration. the hwioauth-fosuser gate itself can create an account. that is, it displays a registration dialog and, if successful, the new account is linked to the social network.
Some of this influenced me, but I don't remember what. this is pure shamanism:

security:
    firewalls:
        main:
            oauth:
                # должны быть указаны чтобы получалась регистрация
                failure_path: /connect
                login_path: /login
                check_path: /connect

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question