A
A
Alexander Konovalov2017-04-12 23:38:46
PHP
Alexander Konovalov, 2017-04-12 23:38:46

How to finalize authorization through VK?

Hello! I do authorization in the admin panel through VK.
This code: https://pastebin.com/uk2u0J2p
The problem is that when you go to the admin panel, you are thrown to the link admin?vk_user_id=123456 (accordingly, it is written in the file from which id to let in), and if you copy If you open this link without authorization, you will still be admitted to the panel.
Why? How to fix this jamb?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
Truth4oll, 2017-04-12
@Truth4oll

User authorization must occur through the access_token received from VKontakte.
Here is a similar question: How is it better to pull out the access_token in VK?

A
Alexey Sundukov, 2017-04-13
@alekciy

If you open it without authorization, you will still be let into the panel.

That's right, because you wrote this in the application code:
VK authentication is done in a completely different way. How exactly is not so important now, because. you clearly have gaps in understanding the general scheme of the server-browser-user operation. To begin with, I recommend reading about application security + using a ready-made CMS or framework.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question