humhub / mail

A private messaging system for direct communication.
https://marketplace.humhub.com/module/mail
29 stars 50 forks source link

REST API Error - auth/login #347

Closed senthilpsg closed 1 year ago

senthilpsg commented 1 year ago

I am trying to integrate humhub to my custom application. I tried to access the REST API for authentication from postman. I am getting below error. I am using humhub version 1.13.1

{ "name": "Exception", "message": "Class \"humhub\\modules\\user\\services\\AuthClientService\" not found", "code": 0, "type": "Error", "file": "D:\\xampp\\htdocs\\humhub\\protected\\modules\\rest\\controllers\\auth\\AuthController.php", "line": 77, "stack-trace": [ "#0 D:\\xampp\\htdocs\\humhub\\protected\\modules\\rest\\controllers\\auth\\AuthController.php(37): humhub\\modules\\rest\\controllers\\auth\\AuthController::authByUserAndPassword('admin', 'senthil')", "#1 [internal function]: humhub\\modules\\rest\\controllers\\auth\\AuthController->actionIndex()", "#2 D:\\xampp\\htdocs\\humhub\\protected\\vendor\\yiisoft\\yii2\\base\\InlineAction.php(57): call_user_func_array(Array, Array)", "#3 D:\\xampp\\htdocs\\humhub\\protected\\vendor\\yiisoft\\yii2\\base\\Controller.php(178): yii\\base\\InlineAction->runWithParams(Array)", "#4 D:\\xampp\\htdocs\\humhub\\protected\\vendor\\yiisoft\\yii2\\base\\Module.php(552): yii\\base\\Controller->runAction('index', Array)", "#5 D:\\xampp\\htdocs\\humhub\\protected\\vendor\\yiisoft\\yii2\\web\\Application.php(103): yii\\base\\Module->runAction('rest/auth/auth/...', Array)", "#6 D:\\xampp\\htdocs\\humhub\\protected\\vendor\\yiisoft\\yii2\\base\\Application.php(384): yii\\web\\Application->handleRequest(Object(humhub\\components\\Request))", "#7 D:\\xampp\\htdocs\\humhub\\index.php(25): yii\\base\\Application->run()", "#8 {main}" ] }

yurabakhtin commented 1 year ago

@senthilpsg You should either use HumHub version 1.14+ or module "REST API" less 0.8.0 version, because I see the class humhub\modules\user\services\AuthClientService is started to be used here https://github.com/humhub/rest/commit/72cfa78#diff-11841a5ed9c3e2f97da12a419bde3b5ec3a8acfab470ab68b8556c1cf3d463dbR16 since version 0.8.0 of the module "REST API", also min HumHub version was updated from 1.13 to 1.14 because the class has the @since 1.14 here https://github.com/humhub/humhub/blob/master/protected/humhub/modules/user/services/AuthClientService.php#L28. Thanks.