Skip to content

Conversation

epenet
Copy link
Collaborator

@epenet epenet commented May 23, 2017

No description provided.

@dregad
Copy link
Member

dregad commented May 23, 2017

See my notes in the other PR #1 (review)

Updates following feedback from @dregad
Copy link
Member

@vboctor vboctor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added some minor comments inline. Here are the high level ones:

  • I'm surprised there are no configs for the IDP itself. Like IDP url, login url, logout url, and cert. So I'm unsure how you redirect to IDP and how you validate that tokens are signed by IDP.
  • It would be good to have a config option for users_saml that can be set to comma separated usernames during config testing.
  • Maybe have a users_no_saml for comma separate array of usernames to not use SAML auth for. This provides the backdoor for administration if SAML is not working for some reason for the admins. We can limit this to admins.
  • I would bundle the SimpleSAMLAuth class rather than having a config option to point to it elsewhere.
  • It would be useful to add instructions to the readme about how to test for developers to be able to verify.


# Passwords managed externally for all users
$t_flags->setCanUseStandardLogin( false );
$t_flags->setPasswordManagedExternallyMessage( 'Passwords are no more, you cannot change them!' );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This message should be localized via a language file.

# No one can use standard auth mechanism

# Override Login page and Logout Redirect
$t_flags->setCredentialsPage( helper_url_combine( plugin_page( 'login', /* redirect */ true ), 'username=' . $t_username ) );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should url encode the username.


# Enable re-authentication and use more aggressive timeout.
$t_flags->setReauthenticationEnabled( true );
$t_flags->setReauthenticationLifetime( 10 );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default 5 minutes seems reasonable. 10 seconds seems to be an overkill even if the overhead is just a redirect to an IDP and back. I suggest leaving this to default in MantisBT or having it as a config for the plugin.


function config() {
return array(
'autoloader_path' => '',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need a file path in the configs? Why can't this path be known by the plugin assuming the library is bundled with the plugin? Even if for some reason we think this is needed, I wouldn't surface it in the UI and keep it as an internal config option that can be overridden in config/config_inc.php. But ideally, I would try to get rid of this config.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is linked to the workings of SimpleSAMLphp.
It is a standalone installation, separate from the core Mantis installation.

function config() {
return array(
'autoloader_path' => '',
'SP_name' => '',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about service_provider as the config option name?


$s_plugin_SimpleSAMLphpAuth_configuration = 'Configuration';
$s_plugin_SimpleSAMLphpAuth_config_autoloader_path = 'SimpleSAMLphp autoloader path';
$s_plugin_SimpleSAMLphpAuth_config_SP_name = 'SimpleSAMLphp SP name';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"config_" isn't really necessary. No need for "SimpleSAMLphp" in the UI string. Also I would use "Service Provider Name" instead of "SP name".

}

function config() {
return array(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about adding a test_users that can be set to a comma separated usernames to only enable the plugin for such users for testing. If not set/empty, then plugin applies to all. That enables the admin to test on a specific accounts before playing around with configs which may lock everybody out.

$t_simplesamlphp_instance = new SimpleSAML_Auth_Simple( plugin_config_get( 'SP_name' ) );
$t_simplesamlphp_instance->requireAuth();
if( $t_simplesamlphp_instance->isAuthenticated() ) {
$t_simplesamlphp_attributes = $t_simplesamlphp_instance->getAttributes();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation seems to be inconsistent.

$t_simplesamlphp_instance->requireAuth();
if( $t_simplesamlphp_instance->isAuthenticated() ) {
$t_simplesamlphp_attributes = $t_simplesamlphp_instance->getAttributes();
$f_username = $t_simplesamlphp_attributes[ plugin_config_get( 'auth_attributes_username' ) ][0];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check that the attribute is set before retrieving it to avoid php errors in case plugin is misconfigured during testing.

readme.md Outdated
This is an authentication plugin for SimpleSAMLphp.

The authentication mechanism implemented by this plugin works as follows:
- If user ID is 1 (Administrator), use standard authentication.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This info seems out of date.

Updates following feedback from @dregad, @vboctor and @libregeek
@c-schmitz
Copy link

Hm, why were the latest changes not reviewed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants