Skip to content

jonasvanderhaegen/magento2-module-toyota-sso

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Toyota SSO Processing Module

This repository contains a Magento 2 module developed to demonstrate technical expertise during job interviews. The module showcases various aspects of Magento 2 module development, including custom helpers, plugins, observers, and SAML (Security Assertion Markup Language) integration.

Module Purpose

The primary purpose of this module is to illustrate skills in:

  • Developing Magento 2 modules
  • Handling SAML2-based Single Sign-On (SSO)
  • Customizing customer group assignments

The original single-sign-on module could map customers to customer groups based on configurations in the system settings. However, the SAML data from Toyota required additional parameters to map customers to the correct groups effectively.

Repository Structure

Since this repository is tailored for simplicity, it only includes the contents of the ToyotaSsoProcessing directory. Typically, this module would reside under app/code/Jvdh/ToyotaSsoProcessing in a Magento 2 project.

Included Components

  1. Helper Classes

    • Helper/Data.php: Contains reusable methods for SSO processing, such as customer group mapping and module configuration checks.
  2. Observers

    • Observer/Saml2CustomerSuccessfullyUpdated.php: Handles SAML2 events, such as updating customer-related data when an SSO process succeeds.
  3. Plugins

    • Plugin/Controller/Saml2/ACS.php: Extends the functionality of the ACS (Assertion Consumer Service) controller to assign customer groups based on SAML attributes.

Configuration

The module relies on specific configurations and environment variables for seamless operation:

  1. Environment Variables

    • Toyota_EMAIL_DOMAINS: Comma-separated list of email domains for mapping customers to specific groups.
    • Toyota_ADMIN_EMAILS: Comma-separated list of admin email addresses for special handling.
  2. Magento Admin Settings

    • Navigate to Stores > Configuration > Foobar > SAML2 Customer to ensure the module is enabled for Toyota integration.

Key Features

  • SAML2 Integration: Leverages SAML2 protocol for secure Single Sign-On.
  • Dynamic Customer Group Assignment: Resolves and assigns customer groups based on predefined mappings and SAML attributes.
  • Session and Quote Handling: Updates customer session and quote data to reflect group changes.
  • Error Handling: Provides user-friendly error messages for missing or incorrect configurations.

Notes

  • This module is a technical demonstration and not intended for production use.
  • Ensure proper configurations and security practices when integrating SAML in live environments.

License

This project is licensed under the MIT License. Feel free to use and modify it as needed.

Author

Developed by me.

Contact

For any questions or further discussions, please feel free to contact me via [your email or LinkedIn profile].

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages