kwent / syno

Simple Node.js wrapper and CLI for Synology DSM REST API 5.x and 6.x.
http://kwent.github.io/syno
MIT License
318 stars 51 forks source link

[Error: The logged in session does not have permission] code: 105 #15

Closed kadishmal closed 7 years ago

kadishmal commented 9 years ago

Receiving 105 error code even when using the admin account.

var Syno = require('syno');

process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";

var syno = new Syno({
    // Requests protocol : 'http' or 'https' (default: http)
    protocol: 'https',
    // DSM host : ip, domain name (default: localhost)
    host: '192.168.119.203',
    // DSM port : port number (default: 5000)
    port: '5001',
    // DSM User account (required)
    account: 'admin',
    // DSM User password (required)
    passwd: 'password'
});

function callback() {
    console.log(arguments);
}

// File Station API - Provide File Station information
syno.fs.getFileStationInfo(callback);

// The above API call returns:
//{ '0': null,
//      '1':
//  { hostname: 'DiskStation',
//          is_manager: true,
//          support_sharing: true,
//          support_vfs: true,
//          support_virtual: 'cifs,iso' } }

// File Station API - Enumerate files in a given folder
syno.fs.listFiles({'folder_path':'/volume1/photo/'}, callback);

// The above API call returns:
// { '0': { [Error: The logged in session does not have permission] code: 105 } }

Found a similar issue at http://forum.synology.com/enu/viewtopic.php?f=223&t=76514 where the user said "I wasn't passing the Session ID by using GET".

kwent commented 8 years ago

@kadishmal I just released a new 2.0.0 version which support 5.x and 6.x version ! Give it a shot and tell me if things looks better.

jquatier commented 8 years ago

I've been running into this as well. It looks like it happens when the account I'm logging in as is not an administrator. Does anyone know if the auth API only allows admin users? I was hoping I could use a normal user account that has less privs.

The Auth API returns: {"error":{"code":402},"success":false}

kwent commented 7 years ago

Might be related to https://github.com/kwent/syno/issues/28.

kwent commented 7 years ago

Hi @kadishmal and @jquatier, i just released 2.1.0 version on NPM.

This issue should be fixed.

Regards,