A
A
Artem Skopintsev2016-04-14 20:53:18
JavaScript
Artem Skopintsev, 2016-04-14 20:53:18

How to register users through VK?

Good time of the day.
I need to register on the site using VK. I need a popup window with an OAuth VK registration form to appear on the page when the button is clicked. After that, in the same window, you need to display several fields for setting up a user account. At the end - the "Finish" button, by pressing which a user is created in the database and redirected to another URI.
I tried using the django-social-auth library first , but it turned out to be outdated. After that I found the AllAuth library and tried to use it. I almost succeeded, but I stopped at this "beautiful" error:

{
     "error": "invalid_request",
     "error_description": "redirect_uri is incorrect, check application redirect uri in the settings page"
}

All this, of course, can be fixed ... probably. But I realized that there is a lot of superfluous, I just need one registration window.
Actually, the question is: how can I implement this miracle? I understand that no one will write a complete instruction for me here, so I will be very grateful if you tell me where to dig. Maybe there are some points when using AJAX in a Django application...
And more. How to properly edit the application settings (VC) and local settings so that you can develop on a local server (I'm talking about settings such as: "Base domain", "Trusted redirect URI")?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Artyom Innokentiev, 2016-04-15
@artinnok

django-social-auth deprecated - no longer maintained, project renamed to python social auth .
Python Social Auth - very easy to use, huge number of supported providers, thoughtful links in the models, I highly recommend it.
If you are interested in other packages for Django, I suggest you go to djangopackages.com . This site contains all packages for Django and classified into categories.
You can register directly in the settings of your VK application. For example:

базовый домен - http://localhost:8000
редирект на - htpp://localhost:8000/success/

Z
zelsky, 2016-04-14
@zelsky

django-allauth has recently used everything fine.

V
Vitaly Inchin ☢, 2016-04-15
@In4in

We go here https://vk.com/dev/openapi
There, in detail, the process of obtaining a token (that is, authorization), user data - where and how to send requests.
Further on the site we will implement all this business.
If the user with the given id is in the database, then this is authorization. Otherwise, we save it in the database and transfer it to the settings page of the created profile.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question