SAML Single Sign-On (SSO) For Laravel Using Azure AD As IDP

SAML Single Sign-On (SSO) For Laravel Using Azure AD As IDP


Laravel SAML Single Sign-On (SSO) plugin gives the ability to enable SAML Single Sign-On for your laravel applications. Using Single Sign-On you can use only one password to access your laravel application and services. Our plugin is compatible with all the SAML compliant Identity providers. Here we will go through a step-by-step guide to configure Single Sign-On (SSO) between Laravel and Azure AD considering Azure AD as IdP.

Pre-requisites : Download And Installation

  • Open a Command Prompt window and change the working directory to your Laravel app's main directory.
  • Enter the below command.
    composer require miniorange/saml-laravel-free
  • Laravel Single Sign On SSO enter commond
  • Note: If you are using Laravel 5.4 or below, you will need to add the following value to the 'providers' array in your app.php file which can be found in the project\config folder :provider\ssoServiceProvider::class (You can check your current Laravel version by using the command php artisan --version.)

  • Laravel Single Sign On SSO add following value
  • After successful installation of package, go to your Laravel app in the browser and enter https://<your-host>/mo_admin in the address bar.
  • The package will start setting up your database for you and then redirect you to the admin registration page.
  • Register or log in with your account by clicking the Register button to configure the plugin.
  • Laravel Single Sign On SSO plugin settings
  • After login, you will see the Service Provider Settings option, where you will get the service provider metadata. Keep the metadata handy as it will be required later to configure step 1.
  • Laravel Single Sign On SSO Service Provider Settings

Steps to configure Azure AD Single Sign-On (SSO) Login into Laravel

1. Configure Azure AD as Identity Provider

  • Log in to Azure AD Portal
  • Select Azure Active Directory.
  • Azure AD Laravel SSO - Azure Single Sign-On(SSO) Login in  Laravel - portal
  • Select Enterprise Application.
  • Azure AD  Laravel SSO - Azure Single Sign-On(SSO) Login in  Laravel - Enterprise registrations
  • Click on New Application.
  • Azure AD  Laravel SSO - Azure Single Sign-On(SSO) Login in  Laravel - New Application
  • Click on Create your own Application.
  • Azure AD  Laravel SSO - Azure Single Sign-On(SSO) Login in  Laravel- Add own Application
  • Enter the name for your app, then select Non-gallery application section and click on Create button.

  • Azure AD  Laravel SSO - Azure Single Sign-On(SSO) Login in Laravel- Add Non-Gallery Application
  • Click on Setup Single sign-on .
  • Azure AD  Laravel SSO - Azure Single Sign-On(SSO) Login in  Laravel - setup-sso
  • Select the SAML  tab.
  • Azure AD  Laravel SSO - Azure Single Sign-On(SSO) Login in  Laravel - select saml
  • After clicking on Edit, enter the SP Entity ID for Identifier and the ACS URL for Reply URL from Service Provider Metadata tab of the plugin.
  • Azure AD  Laravel SSO - Azure Single Sign-On(SSO) Login in Laravel - Select SAML authentication SSO
    Azure AD  Laravel SSO - Azure Single Sign-On(SSO) Login in  Laravel - metadata
  • By default, the following Attributes will be sent in the SAML response. You can view or edit the claims sent in the SAML response to the application under the Attributes tab.
  • Azure AD  Laravel SSO - Azure Single Sign-On(SSO) Login in  Laravel - Configure SAML 2.0
  • Download the App Federation Metadata XML by clicking on Download link, keep the metadata file handy as it will required later to configure step 2.
  • Azure AD  Laravel SSO - Azure Single Sign-On(SSO) Login in  Laravel - Setup SAML 2.0
  • Assign users and groups to your SAML application
    • Navigate to Users and groups tab and click on Add user/group.
    • Azure AD  Laravel SSO - Azure Single Sign-On(SSO) Login in  Laravel - assign groups and users
    • Click on Users to assign the required user and then click on select.
    • Azure AD  Laravel SSO - Azure Single Sign-On(SSO) Login in  Laravel - add users
    • You can also assign a role to your application under Select Role section.

    You have successfully configured Azure AD as SAML IdP ( Identity Provider) for achieving Azure AD SSO login into your Laravel Site.

2. Configure Laravel SAML plugin as Service Provider

  • Go to the miniOrange Laravel SAML 2.0 SSO plugin and click on Choose File button next to the Upload Meatadata option.
  • Select the metadata file we downloaded from your IDP and click on Upload button.
  • Laravel Single Sign On SSO Identity Provider Settings
  • Click on Test Configuration button to test whether the SAML Configuration you've done is correct. On successful test configuration, you will get the different user attributes returned by your identity Provider in a test configuration table.
  • Laravel Single Sign On SSO Test Configuration Laravel Single Sign On SSO Test Result

3. SSO Options

  • Your users can initiate the Single Sign On flow by clicking on the Single Sign On button generated on your login page. If you do not have this page yet, run php artisan make:auth & php artisan migrate to generate the authentication module.

  • Laravel Single Sign On SSO Single Sign On button

In this Guide, you have successfully configured Azure AD SAML Single Sign-On (Azure AD SSO Login) choosing Azure AD as IdP and Laravel as SP using miniOrange plugin-SAML Single Sign On – SSO Login. This solution ensures that you are ready to roll out secure access to your Laravel site using Azure AD login credentials within minutes.

Additional Resources

Hello there!

Need Help? We are right here!

support
Contact miniOrange Support
success

Thanks for your inquiry.

If you dont hear from us within 24 hours, please feel free to send a follow up email to info@xecurify.com