1
1
Fork
You've already forked AuthRemoteUser
1

Make the remote user header a configuration #3

Closed
pscn wants to merge 0 commits from pscn/AuthRemoteUser:master into master
pull from: pscn/AuthRemoteUser:master
merge into: Charly:master
Charly:master
First-time contributor
Copy link

Hi,

I had the same issue as #2. Instead of changing REMOTE_USER to HTTP_REMOTE_USER (authelia uses this) in the code I thought it might be a good idea to provide it as configuration.

Had to rename the class from auth_plugin_AuthRemoteUser to auth_plugin_authremoteuser to get $this->getConf to work (that took some time to figure out).

Thanks for the plugin btw :)

Kind regards,
Peter

Hi, I had the same issue as #2. Instead of changing REMOTE_USER to HTTP_REMOTE_USER (authelia uses this) in the code I thought it might be a good idea to provide it as configuration. Had to rename the class from auth_plugin_AuthRemoteUser to auth_plugin_authremoteuser to get $this->getConf to work (that took some time to figure out). Thanks for the plugin btw :) Kind regards, Peter

Good idea!

But I would prefer some changes:

  1. Variable name serverVarNameOfAuthSystem and configuration server_var_name_of_auth_system is less specific regarding possible other values because they don't refer to anything containing REMOTE_USER.
  2. In line with this, localized string should be "Server's variable name for authenticated users according to your authentication system".

That is:

  1. auth.php, lines 73–76:

    $serverVarNameOfAuthSystem = $this->getConf('server_var_name_of_auth_system');
    if (!empty($_SERVER[$serverVarNameOfAuthSystem])) {
    	$remoteUser = $this->cleanUser($_SERVER[$serverVarNameOfAuthSystem]);
    
  2. conf/default.php, line 3:

    $conf['server_var_name_of_auth_system'] = 'REMOTE_USER';
    
  3. conf/metadata.php, line 3:

    $meta['server_var_name_of_auth_system'] = array('string');
    
  4. lang/en/settings.php, line 3:

    $lang['server_var_name_of_auth_system'] = 'Server\'s variable name for authenticated users according to your authentication system';
    

Do you agree?

Good idea! But I would prefer some changes: 1. Variable name `serverVarNameOfAuthSystem` and configuration `server_var_name_of_auth_system` is less specific regarding possible other values because they don't refer to anything containing REMOTE_USER. 2. In line with this, localized string should be _"Server's variable name for authenticated users according to your authentication system"_. That is: 1. `auth.php`, lines 73–76: ```php $serverVarNameOfAuthSystem = $this->getConf('server_var_name_of_auth_system'); if (!empty($_SERVER[$serverVarNameOfAuthSystem])) { $remoteUser = $this->cleanUser($_SERVER[$serverVarNameOfAuthSystem]); ``` 2. `conf/default.php`, line 3: ```php $conf['server_var_name_of_auth_system'] = 'REMOTE_USER'; ``` 3. `conf/metadata.php`, line 3: ```php $meta['server_var_name_of_auth_system'] = array('string'); ``` 4. `lang/en/settings.php`, line 3: ```php $lang['server_var_name_of_auth_system'] = 'Server\'s variable name for authenticated users according to your authentication system'; ``` Do you agree?
Charly changed title from (削除) Make the remote user header a configuration (削除ここまで) to WIP: Make the remote user header a configuration 2021年08月30日 14:19:21 +02:00
Author
First-time contributor
Copy link

Perfect :)

Will you do the changes or should I update the pull request?

Perfect :) Will you do the changes or should I update the pull request?
Charly changed title from (削除) WIP: Make the remote user header a configuration (削除ここまで) to Make the remote user header a configuration 2021年08月30日 17:27:12 +02:00
Charly closed this pull request 2021年08月30日 17:27:26 +02:00
Author
First-time contributor
Copy link

Awesome! Thank you :)

Awesome! Thank you :)

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Charly/AuthRemoteUser!3
Reference in a new issue
Charly/AuthRemoteUser
No description provided.
Delete branch "pscn/AuthRemoteUser:master"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?