-
Notifications
You must be signed in to change notification settings - Fork 484
feat(auth): Add external authentification feature #1581
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(auth): Add external authentification feature #1581
Conversation
@NicolasToussaint please fix the php alignments.
|
Thanks @shaheemazmalmmd , I pushed a fix that cleared the Travis checks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few suggestions
; Use external Authentication | ||
CONF_EXT_AUTH_ENABLE=false | ||
; Environment variable where to find the User name | ||
CONF_EXT_AUTH_ENV_USER= | ||
; Environment variable where to find the User email | ||
CONF_EXT_AUTH_ENV_MAIL= | ||
; Environment variable where to find the User Description | ||
CONF_EXT_AUTH_ENV_DESC= | ||
; Set to true to use lowercase usernames | ||
CONF_EXT_AUTH_ENV_LOWERCASE_USER= | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be a better idea to move these configurations under their own section (something like EXT_AUTH
).
Then with the help of
function ConfigInit($sysconfdir, &$SysConf) |
$GLOBALS['SysConf']['EXT_AUTH']['CONF_EXT_AUTH_ENABLE']
.
Note: The function is called here:
fossology/src/www/ui/index.php
Line 52 in e326309
ConfigInit($SYSCONFDIR, $SysConf); |
try { | ||
$this->userDao->getUserAndDefaultGroupByUserName($username); | ||
} catch (Exception $e) { | ||
/* If user does not exist then we create it */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this part be configurable with fossology.conf
or some other way to restrict user creation?
/* Set default list of agents when a new user is created */ | ||
$agentList = "agent_bucket,agent_copyright,agent_keyword,agent_mimetype,agent_monk,agent_nomos,agent_ojo"; | ||
$default_bucketpool_fk = 2; | ||
$this->user-add_user($User,$Desc,$Seed,$Hash,$Perm,$Email, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean?
fossology/src/lib/php/common-users.php
Line 44 in 8a17b95
function add_user($User, $Desc, $Seed, $Hash, $Perm, $Email, $Email_notify, |
Also, please change the second commit message ("try to fix indentation to follow Travis rules") to something like "chore(www): Indentation fixes"? |
…egation-3' of github.com:Orange-OpenSource/fossology into o-master/gh-orange/external-authentication-delegation-3
Description
Partially fixes #1273
This PR introduces external authentication, delegated to Apache.
Apache can be configured to perform any kind of authentication, and places relevent information (login, user name, email), etc. in environment variables.
Optionally, all logins may be lower cased.
Further possible improvements:
Changes
fossology.conf.in
src/lib/php/common-auth.php
: new function to check external authentication validitysrc/www/ui/core-auth.php
: check authenticatino and create new account if neededHow to test
Configure the Apache authentication, fossology.conf, and log in.
Sample configurations