The SSO Connector module facilitates the integration of Single Sign-On (SSO) between Drupal sites, enhancing both security and user experience by enabling unified authentication across multiple systems. This module is ideal for organizations managing multiple Drupal sites or applications that require a consistent and secure user authentication method.

Key Features:

Single Sign-On: Allows users to log in once and gain access to multiple related systems without needing to re-authenticate.
User Synchronization: Automatically creates accounts on Service Providers (SPs) if they do not already exist, ensuring a consistent user identity across Identity Providers (IdPs) and SPs.
Configurable Security Settings: Offers customizable security options to tailor the SSO experience according to organizational needs.
User Experience Enhancement: Reduces password fatigue and the potential for password-related security breaches while improving login convenience.

Commitment to Security:

I am committed to maintaining and updating this module in collaboration with the Drupal security team to ensure it adheres to Drupal's best security practices and coding standards.

This module has been developed following strict security standards to ensure that all systems integrated through SSO maintain a high level of protection against vulnerabilities.

I welcome any feedback and am open to making the necessary modifications suggested by reviewers to ensure security coverage and contribute to the Drupal community.

Project link

https://www.drupal.org/project/sso_connector

Thank you for considering this module for security advisory coverage. I am eager to collaborate with the security team and contribute to a safer Drupal community.

CommentFileSizeAuthor
#24 configFormBase.PNG36.1 KBcesarmsfelipe

Comments

cesarmsfelipe created an issue. See original summary.

cesarmsfelipe’s picture

Title: [1.0.0] SSO Connector » [1.0.X] SSO Connector
vishal.kadam’s picture

Thank you for applying!

Please read Review process for security advisory coverage: What to expect for more details and Security advisory coverage application checklist to understand what reviewers look for. Tips for ensuring a smooth review gives some hints for a smoother review.

The important notes are the following.

  • If you have not done it yet, you should run phpcs --standard=Drupal,DrupalPractice on the project, which alone fixes most of what reviewers would report.
  • For the time this application is open, only your commits are allowed.
  • The purpose of this application is giving you a new drupal.org role that allows you to opt projects into security advisory coverage, either projects you already created, or projects you will create. The project status won't be changed by this application and no other user will be able to opt projects into security advisory policy.
  • We only accept an application per user. If you change your mind about the project to use for this application, or it is necessary to use a different project for the application, please update the issue summary with the link to the correct project and the issue title with the project name and the branch to review.

To the reviewers

Please read How to review security advisory coverage applications, Application workflow, What to cover in an application review, and Tools to use for reviews.

The important notes are the following.

  • It is preferable to wait for a Code Review Administrator before commenting on newly created applications. Code Review Administrators will do some preliminary checks that are necessary before any change on the project files is suggested.
  • Reviewers should show the output of a CLI tool only once per application.
  • It may be best to have the applicant fix things before further review.

For new reviewers, I would also suggest to first read In which way the issue queue for coverage applications is different from other project queues.

vishal.kadam’s picture

Issue summary: View changes
rushikesh raval’s picture

Status: Needs review » Needs work

Fix the phpcs Error :

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml sso_connector/

FILE: /sso_connector/README.md
------------------------------------------------------------------------
FOUND 1 ERROR AND 13 WARNINGS AFFECTING 13 LINES
------------------------------------------------------------------------
3 | WARNING | [ ] Line exceeds 80 characters; contains 300 characters
22 | WARNING | [ ] Line exceeds 80 characters; contains 103 characters
24 | WARNING | [ ] Line exceeds 80 characters; contains 150 characters
30 | WARNING | [ ] Line exceeds 80 characters; contains 93 characters
34 | WARNING | [ ] Line exceeds 80 characters; contains 86 characters
36 | WARNING | [ ] Line exceeds 80 characters; contains 123 characters
37 | WARNING | [ ] Line exceeds 80 characters; contains 86 characters
38 | WARNING | [ ] Line exceeds 80 characters; contains 201 characters
39 | WARNING | [ ] Line exceeds 80 characters; contains 138 characters
45 | WARNING | [ ] Line exceeds 80 characters; contains 97 characters
57 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
58 | WARNING | [ ] Line exceeds 80 characters; contains 186 characters
64 | WARNING | [ ] Line exceeds 80 characters; contains 100 characters
64 | ERROR | [x] Expected 1 newline at end of file; 2 found
------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------

FILE: /sso_connector/sso_connector.info.yml
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
1 | WARNING | Remove "version" from the info file, it will be added by
| | drupal.org packaging automatically
--------------------------------------------------------------------------------

FILE: /sso_connector/src/tests/src/Kernel/SsoTokenTest.php
--------------------------------------------------------------------------------
FOUND 10 ERRORS AND 2 WARNINGS AFFECTING 12 LINES
--------------------------------------------------------------------------------
7 | WARNING | [x] Unused use statement
11 | ERROR | [x] Use statements should be sorted alphabetically. The first
| | wrong one is Drupal\KernelTests\KernelTestBase.
15 | WARNING | [x] Unused use statement
74 | ERROR | [x] Whitespace found at end of line
76 | ERROR | [x] Whitespace found at end of line
93 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
94 | ERROR | [x] Expected 5 space(s) before asterisk; 3 found
95 | ERROR | [x] Expected 5 space(s) before asterisk; 3 found
96 | ERROR | [x] Expected 1 blank line before function; 0 found
98 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced
| | with use statements
139 | ERROR | [x] Expected 1 blank line after function; 2 found
142 | ERROR | [x] The closing brace for the class must have an empty line
| | before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 12 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 1.17 secs; Memory: 10MB

vishal.kadam’s picture

@Rushikesh Raval Please include the command that was used, along with its arguments.

vishal.kadam’s picture

1. 1.0.0 and main are wrong names for a branch. Release branch names always end with the literal .x as described in Release branches. The only exception is for the main branch, which is actually not fully supported on drupal.org and should be avoided.

2. FILE: sso_connector.module

/**
 * Implements hook_entity_update().
 *
 * { @inheritdoc }
 */
function sso_connector_entity_update(EntityInterface $entity) {

Remove { @inheritdoc } from the doc comment. {@inheritdoc} is used if you are overriding or implementing a method from a base class or interface.

/**
 * @file
 * Contains hooks and callbacks for the SSO Connector module.
 */

The usual description for a .module file is Hook implementations for the [module name] module. where [module name] is the module name given in the .info.yml file.

rushikesh raval’s picture

Thanks @vishal.kadam. command added in comment.

cesarmsfelipe’s picture

Status: Needs work » Needs review

Thank you both for the feedback, I have solved all the phpcs requirements, deleted wrong branches and fixed the standard comments. Let me know if there is something else to change or improve.

rushikesh raval’s picture

Rest looks fine to me.

Let’s wait for a Code Review Administrator to take a look and if everything goes fine, you will get the role.

avpaderno’s picture

Status: Needs review » Needs work

I did not make a complete review, but the following point needs to be fixed.

Projects hosted on drupal.org are licensed under GPLv2+, the same license used from Drupal core. If you are licensing a project under a different license, it cannot he hosted on drupal.org. More details are given in Drupal Git Contributor Agreement & Repository Usage Policy.

All code that is a derivative work of Drupal (typically PHP code, including but not limited to: core patches, modules, themes, etc) committed to Drupal.org's git repository is licensed as GPL version 2.0 and later (official short identifier: “GPL-2.0-or-later”). This means that the code is licensed under GPLv2, and there exists an option that allows downstream recipients to re-license the code to be under a later version of GPL.

All code submitted to the repository that is a derivative work of Drupal must be and it will automatically be redistributed as GPL-2.0-or-later.

Any code that is not GPL-2.0-or-later compatible or granted an exception by the LWG should not be added to the repository and when found will be removed.

See also If I write a module or theme, do I have to license it under the GPL?

Yes. Drupal modules and themes are a derivative work of Drupal. If you distribute them, you must do so under the terms of the GPL version 2 or later. You are not required to distribute them at all, however.

For code licensed under GPLv3, see I want to release my work under GPL version 3 or under GPL version 2-only. Can I do so and host it on Drupal.org?

No. You can release your work under any GPL version 2 or later compatible license. However, you may only check it into Drupal's Git repositories if you are releasing it under the same license as Drupal itself, that is GPL version 2 or later, allowing users to choose between the terms of the GPL version 2 or the terms in any new versions as updated by the FSF. If you are unable or unwilling to do so, do not check it into a Drupal Git repository.

cesarmsfelipe’s picture

Status: Needs work » Needs review

@apaderno Thanks for your review, I have changed the license using the drupalcode template for version 2.

vishal.kadam’s picture

Status: Needs review » Reviewed & tested by the community

Changes looks fine to me.

Let’s wait for a Code Review Administrator to take a look and if everything goes fine, you will get the role.

cesarmsfelipe’s picture

Hi @vishal.kadam, how is the process going, is it normal to take so long? Sorry for being insistent, this is the first time I apply for this review process.

vishal.kadam’s picture

Yes, it is normal. Sometimes the application queue experiences a backlog, and applications may sit in the queue for months before getting reviewed.

avpaderno’s picture

Status: Reviewed & tested by the community » Needs work
  • The following points are just a start and don't necessarily encompass all of the changes that may be necessary
  • A specific point may just be an example and may apply in other places
  • A review is about code that doesn't follow the coding standards, contains possible security issue, or does not correctly use the Drupal API; the single points are not ordered, not even by importance

src/Controller/SsoController.php

The parent class has already properties and methods for the logger factory, the entity type manager, and the configuration object. There is no need to re-define properties for the same purpose; instead, the parent class methods should be used.

src/Authentication/Provider/CustomCookie.php

The Drupal\user\Authentication\Provider\Cookie class is not part of the public API. It cannot be used as parent class for a contributed module.

src/EventSubscriber/CheckIdPSessionSubscriber.php

    if ($validationResult['valid']) {
      $this->logger->info('Token validation successful.', ['token' => $token]);
      $event->setResponse(new TrustedRedirectResponse($referer . '/from-idp?token=' . $token));
    }

$this->logger->info('Redirecting to IdP for authentication.', ['url' => $idpUrl]);

There isn't any placeholder for token nor url.

+1 👍🏻 for implementing tests.

cesarmsfelipe’s picture

Status: Needs work » Needs review

Thank you for your review and your time @apaderno, I correct the errors you have reported and I am always open to suggestions that can improve performance and security.

vishal.kadam’s picture

Priority: Normal » Major

I am changing priority as per Issue priorities.

cesarmsfelipe’s picture

Should it be in Reviewed and tested by the community? @vishal.kadam

vishal.kadam’s picture

Priority: Major » Critical

I am changing priority as per Issue priorities.

avpaderno’s picture

Priority: Critical » Normal
Status: Needs review » Needs work

I apologize I was not clear in my previous comment: The class constructor needs to call setLoggerFactory().

src/Form/IdpConfigForm.php

  /**
   * Constructs a new CheckIdPSessionSubscriber object.
   *
   * @param \Drupal\sso_connector\Services\UserSyncServiceInterface $user_sync
   *   The synchronization users service.
   */
  public function __construct(UserSyncServiceInterface $user_sync) {
    $this->userSync = $user_sync;
  }

The constructor is not calling the parent class' constructor.

sso_connector.info.yml

core_version_requirement: ^9 || ^10 || ^11

Given the changes in ConfigFormBase, the module cannot be compatible with all those Drupal releases. (In particular, see the changes to the constructor between Drupal 9.x and Drupal 10.x.)

cesarmsfelipe’s picture

Status: Needs work » Needs review

Thank you for the feedback. I have made the necessary changes as you suggested:

IdpConfigForm Constructor: I have updated the constructor to call the parent class's constructor and included the setLoggerFactory() method to ensure proper initialization.

sso_connector.info.yml: I have reviewed and adjusted the core_version_requirement.

Please let me know if there are any further adjustments needed.

avpaderno’s picture

ConfigFormBase::__construct() requires two parameters.

cesarmsfelipe’s picture

StatusFileSize
new36.1 KB

Hi @avpaderno sorry I thought it wasn't necessary as it is null set by default in the configFormBase.
constructor
However, I have added it, thanks for the feedback.

avpaderno’s picture

It has a default value in Drupal 10, but Drupal 10 will trigger a deprecation error.

public function __construct(ConfigFactoryInterface $config_factory, $typedConfigManager = NULL) {
    $this->setConfigFactory($config_factory);
    if (!$typedConfigManager instanceof TypedConfigManagerInterface) {
        $type = get_debug_type($typedConfigManager);
        @trigger_error("Passing {$type} to the \$typedConfigManager parameter of ConfigFormBase::__construct() is deprecated in drupal:10.2.0 and must be an instance of \\Drupal\\Core\\Config\\TypedConfigManagerInterface in drupal:11.0.0. See https://www.drupal.org/node/3404140", E_USER_DEPRECATED);
    }
}

Furthermore, in Drupal 11, that parameter does not have any default value.

avpaderno’s picture

Assigned: Unassigned » avpaderno
Status: Needs review » Reviewed & tested by the community

Thank you for your contribution and for your patience with the review process!

I am going to update your account so you can opt into security advisory coverage any project you create, including the projects you already created.

These are some recommended readings to help you with maintainership:

You can find more contributors chatting on Slack or IRC in #drupal-contribute. So, come hang out and stay involved!
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

I thank the dedicated reviewers as well.

avpaderno’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.