Im trying to get email address. After success login i have firstname, lastname, all except email. please help.
VK.Auth.login(function (response) {
if (response.session) {
} else {
}
}, 4194304);
Im trying to get email address. After success login i have firstname, lastname, all except email. please help.
VK.Auth.login(function (response) {
if (response.session) {
} else {
}
}, 4194304);
There is no way to do that. Vk is specific social network.
When you get Access Token, VK also gives you Email and User ID, but you need specific permission for that - "email".
vk.com now has that functionality. Try checking out this documentation page: https://vk.com/dev/permissions
Yes this way does not give the email. But there is the way to get email via OAuth (for sites vk.com/dev/auth_sites), email will be returned in GET parameters along with token.
in Coffescript/Javascript you can use window.open(...)
appId = 'your app id'
redirectUri = 'your redirect uri'
url = 'https://oauth.vk.com/authorize?client_id='+appId+'&display=popup&redirect_uri='+redirectUri+'&response_type=token&scope=email'
newWin = window.open(url, 'vk-login', 'width=665,height=370')
And later you have two way to get email
There is no way to do that. Vk is specific social network.
you can use window.open
var url = 'https://oauth.vk.com/authorize?client_id=APP_ID&scope=email&redirect_uri=http://yoursite.com&response_type=token'
var newWin = window.open(url, 'vk-login', 'width=665,height=370')
newWin.onload = function() {
var hash = newWin.location.hash
console.log(hash)
}
© 2022 - 2024 — McMap. All rights reserved.