Answer the question
In order to leave comments, you need to log in
Is it possible to identify a website visitor's VK?
There is a task to identify a website visitor in social networks without using clickjacking. Exceptionally automatic. Is there even the slightest chance of doing this? Half a week I can not get just one parameter, the most important - VKontakte ID. I'm trying to do everything by opening the sources of other similar services, but so far it doesn't work out. Everywhere there is protection at the leading level, which makes the inserted codes impregnable.
Answer the question
In order to leave comments, you need to log in
You can’t do without clickjacking, all the services that write that you can blatantly lie.
If without the knowledge of the user, then this is prohibited by the rules of the VKontakte site and you can get a blocking of the transition to your site from links on the social network.
On mailing spam sites, on advertising sites, on porn sites, you often come in and see your profile, this is done through a hidden comment form, they brazenly get your photo and a link to your profile.
If your site is NOT a registered social service application, this is unrealistic.
I don't know how to work with callbacks without jQuery or without any angular.
Substitute your app_id and app_domain.
If the user is not logged into VK, then nothing will be returned. Process it yourself.
function userIdRequest(token) {
var vkUrl = "https://api.vk.com/method/users.get?access_token=" + token
$.ajax({
url: vkUrl,
jsonp: "callback",
dataType: "jsonp",
success: function( response ) {
console.log( response );
}
});
}
function getUserId() {
var vkUrl = "https://login.vk.com/?act=openapi&oauth=1&aid={APP_ID}&location={APP_DOMAIN}&new=1"
var xhr = new XMLHttpRequest();
xhr.open('GET', vkUrl, true);
xhr.withCredentials = true;
xhr.onload = function() {
var res = JSON.parse(xhr.responseText);
userIdRequest(res.access_token);
}
xhr.send();
}
getUserId()
Everything is simple. Get yourself an application in VK, and then you will officially receive user status .
Of the normal methods, only clickjacking. If someone knows others, he keeps them secret. It is better to read the VK documentation in depth.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question