Since March, 6 2023 the PHP API loginservice doen't work anymore.
The errormessage is INVALID_OPERATION.
I updated the PHP API scripts to the 4.15 version, but still it insn't possible to login using de PHP API loginService...
I tried to use the UserService for a search, the errorcode i get when using the UserService is: INVALID_CHANNEL_USAGE
Probably something has changed since march 6 in the channel config?
PHP Webservice LoginService fails since march, 6 2023
Moderators: alexandre, hugo, rmvanarkel
PHP Webservice LoginService fails since march, 6 2023
Last edited by marcel on Sun Apr 02, 2023 12:50 pm, edited 1 time in total.
Re: PHP Webservice LoginService fails since march, 6 2023
Beneath the var_dump from $e (error). I replaced some information to protect sensitive information.
UserServiceError while performing login: INVALID_OPERATIONobject(Cyclos\ServiceException)#5 (11) {
["service"]=>
string(12) "loginService"
["operation"]=>
string(9) "loginUser"
["errorCode"]=>
string(17) "INVALID_OPERATION"
["error"]=>
object(stdClass)#4 (2) {
["class"]=>
string(44) "org.cyclos.web.rpc.InvalidOperationException"
["errorCode"]=>
string(17) "INVALID_OPERATION"
}
["message":protected]=>
string(71) "Error calling Cyclos service: loginService.loginUser: INVALID_OPERATION"
["string":"Exception":private]=>
string(0) ""
["code":protected]=>
int(0)
["file":protected]=>
string(80) "/home/ruilwinkel/domains/ruilwinkeleygelshoven.nl/public_html/Cyclos/Service.php"
["line":protected]=>
int(36)
["trace":"Exception":private]=>
array(2) {
[0]=>
array(6) {
["file"]=>
string(85) "/home/ruilwinkel/domains/ruilwinkeleygelshoven.nl/public_html/Cyclos/LoginService.php"
["line"]=>
int(81)
["function"]=>
string(5) "__run"
["class"]=>
string(14) "Cyclos\Service"
["type"]=>
string(2) "->"
["args"]=>
array(2) {
[0]=>
string(9) "loginUser"
[1]=>
array(1) {
[0]=>
object(stdClass)#3 (3) {
["user"]=>
array(1) {
["principal"]=>
string(8) "netadmin"
}
["password"]=>
string(19) "Rw_2017_13nultwee17"
["remoteAddress"]=>
string(37) "2003:c2:e704:8201:bc97:bdd7:c2d7:eed4"
}
}
}
}
[1]=>
array(6) {
["file"]=>
string(77) "/home/ruilwinkel/domains/ruilwinkeleygelshoven.nl/public_html/Cyclos/test.php"
["line"]=>
int(29)
["function"]=>
string(9) "loginUser"
["class"]=>
string(19) "Cyclos\LoginService"
["type"]=>
string(2) "->"
["args"]=>
array(1) {
[0]=>
object(stdClass)#3 (3) {
["user"]=>
array(1) {
["principal"]=>
string(8) "netadmin"
}
["password"]=>
string(19) "Rw_2017_13nultwee17"
["remoteAddress"]=>
string(37) "2003:c2:e704:8201:bc97:bdd7:c2d7:eed4"
}
}
}
}
["previous":"Exception":private]=>
NULL
}
UserServiceError while performing login: INVALID_OPERATIONobject(Cyclos\ServiceException)#5 (11) {
["service"]=>
string(12) "loginService"
["operation"]=>
string(9) "loginUser"
["errorCode"]=>
string(17) "INVALID_OPERATION"
["error"]=>
object(stdClass)#4 (2) {
["class"]=>
string(44) "org.cyclos.web.rpc.InvalidOperationException"
["errorCode"]=>
string(17) "INVALID_OPERATION"
}
["message":protected]=>
string(71) "Error calling Cyclos service: loginService.loginUser: INVALID_OPERATION"
["string":"Exception":private]=>
string(0) ""
["code":protected]=>
int(0)
["file":protected]=>
string(80) "/home/ruilwinkel/domains/ruilwinkeleygelshoven.nl/public_html/Cyclos/Service.php"
["line":protected]=>
int(36)
["trace":"Exception":private]=>
array(2) {
[0]=>
array(6) {
["file"]=>
string(85) "/home/ruilwinkel/domains/ruilwinkeleygelshoven.nl/public_html/Cyclos/LoginService.php"
["line"]=>
int(81)
["function"]=>
string(5) "__run"
["class"]=>
string(14) "Cyclos\Service"
["type"]=>
string(2) "->"
["args"]=>
array(2) {
[0]=>
string(9) "loginUser"
[1]=>
array(1) {
[0]=>
object(stdClass)#3 (3) {
["user"]=>
array(1) {
["principal"]=>
string(8) "netadmin"
}
["password"]=>
string(19) "Rw_2017_13nultwee17"
["remoteAddress"]=>
string(37) "2003:c2:e704:8201:bc97:bdd7:c2d7:eed4"
}
}
}
}
[1]=>
array(6) {
["file"]=>
string(77) "/home/ruilwinkel/domains/ruilwinkeleygelshoven.nl/public_html/Cyclos/test.php"
["line"]=>
int(29)
["function"]=>
string(9) "loginUser"
["class"]=>
string(19) "Cyclos\LoginService"
["type"]=>
string(2) "->"
["args"]=>
array(1) {
[0]=>
object(stdClass)#3 (3) {
["user"]=>
array(1) {
["principal"]=>
string(8) "netadmin"
}
["password"]=>
string(19) "Rw_2017_13nultwee17"
["remoteAddress"]=>
string(37) "2003:c2:e704:8201:bc97:bdd7:c2d7:eed4"
}
}
}
}
["previous":"Exception":private]=>
NULL
}
Re: PHP Webservice LoginService fails since march, 6 2023
Just to confirm: you're using Cyclos communities, not a self-hosted instance, right?
Communities was upgraded to version 4.16-BETA on March 6.
The WEB-RPC services, which the PHP library uses is not stable, and have been in the path of being replaced by the new REST API, which was launched in 2016.
Nowadays, virtually every single user-facing functionality is available through the REST API.
The login / login users operations have been removed from WEB-RPC in 4.16.
The replacement for the LoginService.loginUser operation is POST /api/sessions (see https://demo.cyclos.org/api in the Sessions tag).
It receives basically the same previous arguments, plus the optional but recommended userAgentId, which is a randomly generated UUID to be stored in the client's browser localStorage, and is used to notify about users accessing from new devices.
Communities was upgraded to version 4.16-BETA on March 6.
The WEB-RPC services, which the PHP library uses is not stable, and have been in the path of being replaced by the new REST API, which was launched in 2016.
Nowadays, virtually every single user-facing functionality is available through the REST API.
The login / login users operations have been removed from WEB-RPC in 4.16.
The replacement for the LoginService.loginUser operation is POST /api/sessions (see https://demo.cyclos.org/api in the Sessions tag).
It receives basically the same previous arguments, plus the optional but recommended userAgentId, which is a randomly generated UUID to be stored in the client's browser localStorage, and is used to notify about users accessing from new devices.
Luis Fernando Planella Gonzalez
Cyclos development team
Cyclos development team
Re: PHP Webservice LoginService fails since march, 6 2023
You're right, we are using Cyclos communities.
Thank you for your answer, i didn't know the LoginService was removed from WEB-RPC.
I'll look at the REST API.
Thank you for your answer, i didn't know the LoginService was removed from WEB-RPC.
I'll look at the REST API.