Open battosai30 opened 1 year ago
Same problem. Thanks for the solution.
Hi, I am student and I have the same problem. Thanks for the solutions. But I have a question, why this bug is not yet implemented in Dolibarr?
Hi,
Did you try to set a value to the $dolibarr_main_url_root
variable in the conf/conf.php
config file?
Source: https://wiki.dolibarr.org/index.php?title=Fichier_de_configuration
The value you indicate is required, so, it has already been set
Bug
Hi,
So cool that OpenID is finally here :)
But I had to modify the code to get it working ...
So I set up my Keycloak client and in logs when I try to log in I got "Error bad hostname IP (IP is a local IP). Must be an external URL." After some digging I found that the isIPAllowed() function used in getURLContent() functio used line 70 and 77 of htdocs/core/login/functions_openid_connect.php raised 'Error bad hostname IP (IP is a local IP). Must be an external URL.' error.
My changes :
$token_response = getURLContent($conf->global->MAIN_AUTHENTICATION_OIDC_TOKEN_URL, 'POST', http_build_query($auth_param));
to$token_response = getURLContent($conf->global->MAIN_AUTHENTICATION_OIDC_TOKEN_URL, 'POST', http_build_query($auth_param),1,array(),array('http', 'https'), 2);
and
$userinfo_response = getURLContent($conf->global->MAIN_AUTHENTICATION_OIDC_USERINFO_URL, 'GET', '', 1, $userinfo_headers);
to
$userinfo_response = getURLContent($conf->global->MAIN_AUTHENTICATION_OIDC_USERINFO_URL, 'GET', '', 1, $userinfo_headers, array('http', 'https'), 2);
The solution comes from "$localurl" parameter forced to value 2.
Some informations :
I guess the problem comes from my architecture :
So we have :
Keycloak <---> Nginx Reverse <---> Dolibarr
Regards
Environment Version
18.0.1
Environment OS
Alpine
Environment Web server
Nginx
Environment PHP
8.0.25
Environment Database
MySQL
Environment URL(s)
No response
Expected and actual behavior
No response
Steps to reproduce the behavior
No response
Attached files
No response