Laravel OAuth Single Sign-On (SSO) Using WordPress as OAuth Provider

Laravel OAuth Single Sign-On (SSO) Using WordPress as OAuth Provider


Laravel OAuth Single Sign-On (SSO) plugin gives the ability to enable OAuth 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 OAuth compliant Identity providers. Here we will go through a step-by-step guide to configure Single Sign-On (SSO) between Laravel and WordPress considering WordPress as OAuth provider. To know more about other features we provide in Laravel OAuth single-sign-on-sso plugin, you can click here.

Download And Installation

  • Log into your WordPress instance as an admin.
  • Go to the WordPress Dashboard -> Plugins and click on Add New.
  • Search for a WordPress WP OAuth Server (Login with WordPress) plugin and click on Install Now.
  • Once installed click on Activate.


  • Installation Laravel Oauth Client

  • Open a Command Prompt window and change the working directory to your Laravel app's main directory.
  • Enter the below command.
    composer require miniorange/oauth-laravel-free
  • After successful installation of package, go to your Laravel app in the browser and enter {laravel-application-domain}/mo_oauth_admin.php
  • 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 miniOrange account to configure the plugin.
  • Laravel Single Sign On SSO plugin settings
  • After login, you will see the OAuth provider Settings option, where you will get the Redirect/Callback URL. Keep it handy as it will be required later to configure WordPress OAuth Single Sign-On SSO plugin.
  • Laravel Single Sign On SSO OAuth Client Settings

    Steps to configure WordPress Single Sign-On (SSO) Login into Laravel Oauth client

    1. Configure WordPress as OAuth Provider

    • Go to miniOrange OAuth Server plugin on the left side menu and choose your OAuth client from the list, Here Custom OAuth 2.0 client.
    • Single Sign-On (SSO) between two WordPress Sites - select wordpress
    • Enter Client name as you want and Copy Redirect / Callback URL from Laravel OAuth SSO and enter under Redirect URI field. Click on Save client button.
    • Single Sign-On (SSO) between two WordPress Sites - add redirect / callback url
    • Now, Note down Client Id and Client Secret and Endpoints to configure laravel OAuth Single Sign-On (SSO) plugin.
    • Single Sign-On (SSO) between two WordPress Sites - get client-id client-secret

      If you are getting 404 for the above endpoints, please make sure you haven't selected Plain in the Permalink Settings.


      Single Sign-On (SSO) 404 Permalink Settings

    2. Configure Laravel OAuth server plugin for WordPress

    • Go to the miniOrange Laravel OAuth SSO plugin and click on Choose WordPress as OAuth provider.
    • Laravel Single Sign On SSO select app
    • Enter the Client ID and Client Secret from miniOrange OAuth server plugin.
    • Laravel Single Sign On SSO save settings
    • Please refer the below table for configuring the Scope and Endpoints or else you can copy from oauth server plugin :

    • Scope: openid profile email
      Authorize Endpoint: {Your-Domain}/wp-json/moserver/authorize
      Access Token Endpoint: {Your-Domain}/wp-json/moserver/token
      Get UserInfo Endpoint: {Your-Domain}/wp-json/moserver/resource

    • Now, You can send the client credentials in header or body and also send state parameter accordingly also enter login attribute as your requirement.
    • Laravel Single Sign On SSO select app
    • Click on save settings button. After that, Click on test configuration button. you will get the list of Attribute Names and Attribute Values that are sent by your OAuth provider
    • Laravel Single Sign On SSO save settings

    3. SSO Options

    • You can also use a link to login via your OAuth/OpenID provider.
    • This link is in the format:
      {laravel-application-domain}/ssologin.php?option=oauthredirect

4. Support / Demo

  • Support and Trial/Demo Request tabs are available for customers to reach out to for demos and support.
  • Laravel Single Sign On SSO Single Sign On button Laravel Single Sign On SSO Single Sign On button

In this Guide, you have successfully configured Single Sign-On (WordPress SSO Login) choosing WordPress as OAuth provider and Laravel as OAuth Client using miniOrange plugin OAuth server Single Sign On – SSO Login. This solution ensures that you are ready to roll out secure access to your Laravel site using WordPress 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