Why method photos.getAlbums may return {error: {error_code: 15, error_msg: "Access denied"}}?

Just started to deal with the javascript SDK. Try to use the method of photos.getAlbums.
Request, do so:
 apiId: *******,
 scope: 4
var app = {
 auth: {} // authorization result
 VK.Auth.login(function(response) {
 $.each(response, function (index, value) {
 app.auth[index] = value;
 VK.Api.call('photos.getAlbums', {owner_id: this.auth.session.user.id
 function(r) {

In the result in r have error - "Access denied." Where is the error?
August 19th 19 at 23:05
2 answers
August 19th 19 at 23:07
The mask permissions, you must specify in VK.init, and the second parameter VK.Auth.login like this:
VK.Auth.login(function(response) {
 // ...
}, 4);
August 19th 19 at 23:09
See scope parameter. This error means that there is no permission to view the albums.
#UPD: https://vk.com/dev/openapi?f=3.1.%2BVK.Auth.login
Here see how: javascript.ru/forum/angular/41626-avtorizaciya-s-p...
There is no certainty that in the right place to indicate scope.
4 - permission for photos, but authorization is not requested permits, which are supposed to be.
The documentation was not able to clarify this issue. - Alford.Mohr commented on August 19th 19 at 23:12
: Well I do this 200 years ago it had. Don't remember a hundred Yes how. But about scope infa 146% - al_Ha commented on August 19th 19 at 23:15
Thanks, you really helped. From the example on the forum found out that the permissions are not in VK.init, and the second parameter in VK.Auth.login . The code earned - Alford.Mohr commented on August 19th 19 at 23:18

Find more questions by tags VKontakte