worteks / humhub-auth-oidc Goto Github PK
View Code? Open in Web Editor NEWOIDC connector for humhub
OIDC connector for humhub
Hi!
I am currently integrating Keycloak with Humhub with you component but i recieve error 400 for response.
yii\authclient\InvalidResponseException: Request failed with code: 400, message: <html><head><title>Error</title></head><body>Bad Request</body></html> in /var/www/html/humhub/protected/vendor/yiisoft/yii2-authclient/src/BaseOAuth.php:232 Stack trace: #0 /var/www/html/humhub/protected/vendor/yiisoft/yii2-authclient/src/BaseOAuth.php(340): yii\authclient\BaseOAuth->sendRequest(Object(yii\httpclient\Request)) #1 /var/www/html/humhub/protected/vendor/worteks/yii2auth-oidc/src/OIDC.php(115): yii\authclient\BaseOAuth->api('https://login.c...', 'GET', Array, Array) #2 /var/www/html/humhub/protected/vendor/yiisoft/yii2-authclient/src/BaseClient.php(174): worteks\yii\authclient\OIDC->initUserAttributes() #3 /var/www/html/humhub/protected/humhub/modules/user/controllers/AuthController.php(107): yii\authclient\BaseClient->getUserAttributes() #4 [internal function]: humhub\modules\user\controllers\AuthController->onAuthSuccess(Object(worteks\humhub\authclient\OIDC)) #5 /var/www/html/humhub/protected/vendor/yiisoft/yii2-authclient/src/AuthAction.php(248): call_user_func(Array, Object(worteks\humhub\authclient\OIDC)) #6 /var/www/html/humhub/protected/humhub/modules/user/authclient/AuthAction.php(43): yii\authclient\AuthAction->authSuccess(Object(worteks\humhub\authclient\OIDC)) #7 /var/www/html/humhub/protected/vendor/yiisoft/yii2-authclient/src/AuthAction.php(417): humhub\modules\user\authclient\AuthAction->authSuccess(Object(worteks\humhub\authclient\OIDC)) #8 /var/www/html/humhub/protected/vendor/yiisoft/yii2-authclient/src/AuthAction.php(226): yii\authclient\AuthAction->authOAuth2(Object(worteks\humhub\authclient\OIDC), Array) #9 /var/www/html/humhub/protected/humhub/modules/user/authclient/AuthAction.php(35): yii\authclient\AuthAction->auth(Object(worteks\humhub\authclient\OIDC)) #10 /var/www/html/humhub/protected/vendor/yiisoft/yii2-authclient/src/AuthAction.php(210): humhub\modules\user\authclient\AuthAction->auth(Object(worteks\humhub\authclient\OIDC)) #11 [internal function]: yii\authclient\AuthAction->run() #12 /var/www/html/humhub/protected/vendor/yiisoft/yii2/base/Action.php(94): call_user_func_array(Array, Array) #13 /var/www/html/humhub/protected/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\Action->runWithParams(Array) #14 /var/www/html/humhub/protected/vendor/yiisoft/yii2/base/Module.php(528): yii\base\Controller->runAction('external', Array) #15 /var/www/html/humhub/protected/vendor/yiisoft/yii2/web/Application.php(103): yii\base\Module->runAction('user/auth/exter...', Array) #16 /var/www/html/humhub/protected/vendor/yiisoft/yii2/base/Application.php(386): yii\web\Application->handleRequest(Object(humhub\components\Request)) #17 /var/www/html/humhub/index.php(25): yii\base\Application->run() #18 {main}
Analyzing the php code shown in the exception we realize that it performs two executions of the function "return $ this-> sendRequest ()" in the file "yii2-authclient / src / BaseOAuth.php", The first execution gives state 200 but immediately performs another which results in state 400
resulting in another error that is "Headers already sent".
My common.php file has following:
'oidc' => [ 'class' => 'worteks\humhub\authclient\OIDC', 'domain' => 'https://login.domain.cl/auth/realms/master', 'apiBaseUrl' => '/', 'authUrl' => '/protocol/openid-connect/auth', 'tokenUrl' => '/protocol/openid-connect/token', 'userInfoUrl' => 'https://login.domain.cl/auth/realms/master/protocol/openid-connect/userinfo', 'clientId' => 'my-client-id', 'clientSecret' => '640886ce-5a81-4c1b-a6c9-03e275162e1b', 'defaultTitle' => 'Ingreso SSO', 'cssIcon' => 'fa fa-sign-in' ],
I'm using:
Thanks and greetings in advance!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.