miniorange / oauth-laravel-free
Laravel OAuth Single Sign On Solution. Make yourLaravel application as OAuth Client using this plugin. Laravel end users can login into Laravel application using their OAuth Provider / Server credentials.
Installs: 2 289
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 3
Forks: 2
Open Issues: 0
Language:CSS
Requires
- php: ^5.1 || ^7.1 || ^8.0
- laravel/framework: >=5.2
README
Single Sign-On is an authorization and authentication process that enables an user to connect to multiple enterprise applications using a single set of credentials. Simply put, SSO combines multiple application login pages into just one, allowing you to submit credentials just once and gain access to all the applications without having to log in to each one individually. End users save time and effort by not having to sign into and out of a variety of on-premises, web and cloud applications on a regular basis.
SSO is a critical component of the Identity and Access Management or access privileges services. SSO solution perfectly implemented within an enterprise simplifies overall password management, improving productivity and security, lowering the likelihood of weak, lost, or forgotten passwords
Laravel OAuth SSO
Laravel OAuth Single Sign On Solution makes your Laravel application as OAuth Client using this package. Laravel end users can login into your Laravel application using their OAuth Provider / Server credentials.
We support all known OAuth Providers - Azure AD, Azure B2C, Office 365, AWS Cognito, Classlink, Discord, Clever, Ping, Keycloak, WHMCS, Okta, WSO2, Identity Server, Onelogin, Salesforce, G Suite / Google Apps, Invision Community, Slack, Amazon, Twitter, Apple, ID.me, Shell, Cisco Webex, Auth0, miniOrange etc. OAuth Single Sign on (SSO) acts as a OAuth 2.0 Client and securely authenticate users with your OAuth 2.0 Provider.
Requirements
- Laravel - 7.0+
- PHP - ^5.1 || ^7.1 || ^8.0
Installation - Composer
- Install the package via composer in your Laravel app's main directory.
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
-
The package will start setting up your database for you and then redirect you to the admin registration page where you can register or login with miniOrange and setup your OAuth Provider.
Configuring the package
-
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 your OAuth Provider.
-
Choose an OAuth Provider from the dropdown. For e.g. WordPress
-
Use your OAuth Provider details like Client ID and Client Secret to configure the plugin. After that, you can enter the Scope, Authorization Endpoint, Access Token Endpoint, GetUserinfo Endpoint, Realm, Domain, Tenant (as per your OAuth Provider or use the default ones provided already). You can send the client credentials in header or body and also send state parameter accordingly.
-
Click on Save Settings button.
Test Configuration
-
You can test if the package is configured properly or not by clicking on the Test Configuration button. You should see a Test Successful screen as shown below along with the user's attribute values.
Adding Single Sign On button on the application login page (Optional)
Once the package is installed, you can add a Single Sign On button in your application login page using these commands in order:
- Install the Laravel UI Package.
composer require laravel/ui
- Generate Auth Routes using VueJs
php artisan ui vue --auth
- Install Node modules and run the development
npm install && npm run dev
- Migrate and update the database
php artisan migrate
The Laravel application login page should look something like this then.
Features
The features provided in the free and premium are listed here.
Feature Description
-
Advanced and Custom Attribute Mapping
It allows you to map the recieved custom attributes sent by your OAuth Provider to the OAuth Client (Laravel Application).
-
Auto-create users in Laravel
Creates the users from the OAuth Provider to OAuth Client (Laravel Application) when SSO is done.
-
OAuth/OpenID Supported Grant Types
Multiple grant type support like Authorization Code Grant, Password Grant, Client Credentials Grant, Implicit Grant, Refresh Token Grant and Authorization Code Grant with PKCE.
-
JWT Vadilation Support
HSA and RSA alogirthm support for JWT validation.
-
Protect Complete Site and Auto-Redirect
Asking user to login via SSO if the user session does not exist everytime the site is accessed.
Single Sign On (SSO)
The Single Sign On can be initiated using {laravel-application-domain}/ssologin.php?option=oauthredirect or the Single Sign On button (if added using the commands above) on the login page of the Laravel application.