PHPackages                             ziffmedia/laravel-onelogin - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. ziffmedia/laravel-onelogin

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

ziffmedia/laravel-onelogin
==========================

Simplified integration of OneLogin for Laravel applications.

v1.2.0(2y ago)1047.3k↓64.2%4[2 issues](https://github.com/ziffmedia/laravel-onelogin/issues)[1 PRs](https://github.com/ziffmedia/laravel-onelogin/pulls)MITPHP

Since Apr 10Pushed 2y agoCompare

[ Source](https://github.com/ziffmedia/laravel-onelogin)[ Packagist](https://packagist.org/packages/ziffmedia/laravel-onelogin)[ RSS](/packages/ziffmedia-laravel-onelogin/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)Dependencies (2)Versions (4)Used By (0)

Laravel onelogin
================

[](#laravel-onelogin)

A Laravel package for allowing onelogin to provide authentication and users to your application. This library wraps onelogin's [onelogin/php-saml](https://github.com/onelogin/php-saml) library.

Features:

- simplified configuration process
- top level (configurable) `login` and `logout` routes
- support for autologin
- support for application single logout
- ability to map any User attributes via a login event
- loose SAML workflow for localhost/local environments, strict when in production

Installation
============

[](#installation)

```
composer require ziffmedia/laravel-onelogin

```

Next, publish the configuration file:

```
artisan vendor:publish --provider='ZiffMedia\LaravelOnelogin\OneloginServiceProvider'

```

### Note for Laravel 5.7+

[](#note-for-laravel-57)

If your application uses Laravel 5.7 or greater, please make sure this package is updated to v0.0.7 or greater.

Configuration &amp; Setup
=========================

[](#configuration--setup)

Go into your onelogin administration screen, search for any application (for example one with "SAML" in the name). This is *not* the connector to use, instead in the URL replace the app connector id with `43457`so that it reads something like `https://.onelogin.com/apps/new/43457`. Create an app from this connector template.

The onelogin tutorial is a great reference at

Once you have an app in onelogin minimally setup, utilize the App &gt; SSO tab to get the necessary values to put inside the configuration file. See [./config/onelogin.php](./config/onelogin.php)for details on which fields are necessary.

Application single logout
=========================

[](#application-single-logout)

If you want the onelogin IDP to log your users out of your application when they logout of onelogin, then you need to configure onelogin to know where the single logout url is.

Configure the onelogin application under App -&gt; Configuration, set your single logout url with the url of your laravel application with the route for onelogin.logout

`https://yourdomain.com/onelogin/logout`

When this url is called, the user will be logged out of your application auth guard.

The User Setup
--------------

[](#the-user-setup)

(The following setup assumes your users will be populated by onelogin the first time they successfully try to log into your application.)

Out the box, this package is designed to work with the typical user schema provided with laravel with minimal changes. Typical changes to make look like this:

- remove the `2014_10_12_100000_create_password_resets_table.php` migration file
- remove the `$table->timestamp('email_verified_at')->nullable();` and `$table->string('password');` columns from the `2014_10_12_000000_create_users_table.php` migration

### (Optional) Laravel Nova...

[](#optional-laravel-nova)

Laravel Nova's default installation adds authentication routes to your application, it is wise to remove them inside your application's `NovaServiceProvider`:

```
    /**
     * Register the Nova routes.
     *
     * @return void
     */
    protected function routes()
    {
        Nova::routes()
                // ->withAuthenticationRoutes()
                // ->withPasswordResetRoutes()
                ->register();
    }
```

### User Attributes and New User Workflow

[](#user-attributes-and-new-user-workflow)

By default, the following actions happen on successful login (From the OneloginController):

```
    protected function resolveUser(array $userAttributes)
    {
        $userClass = config('auth.providers.users.model');

        $user = $userClass::firstOrNew(['email' => $credentials['User.email'][0]]);

        if (isset($credentials['User.FirstName'][0]) && isset($credentials['User.LastName'][0])) {
            $user->name = "{$credentials['User.FirstName'][0]} {$credentials['User.LastName'][0]}";
        }

        $user->save();

        return $user;
    }
```

To customize this experience, create an Event inside your applications `EventServiceProvider`'s boot() method:

```
    public function boot()
    {
          // assuming: use ZiffMedia\LaravelOnelogin\Events\OneloginLoginEvent;

          Event::listen(OneloginLoginEvent::class, function (OneloginLoginEvent $event) {
              $user = User::firstOrNew(['email' => $event->userAttributes['User.email'][0]]);

              if (isset($event->userAttributes['User.FirstName'][0]) && isset($event->userAttributes['User.LastName'][0])) {
                  $user->name = "{$event->userAttributes['User.FirstName'][0]} {$event->userAttributes['User.LastName'][0]}";
              }

              // other custom logic here

              $user->save();

              return $user;
          });
    }
```

Local Users in Development (To Bypass Onelogin)
===============================================

[](#local-users-in-development-to-bypass-onelogin)

To shortcut the onelogin SAML flow in development, your app has to be in the `local` environment, then ensure that `app.debug` is `true`, and finally add the following configuration to your `config/onelogin.php` file:

```
    'local_user' => [
        'enable' => true,

        'attributes' => [
            'email' => 'developer@example.com',
            'name' => 'Software Developer'
        ]
    ]
```

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 78.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~633 days

Total

3

Last Release

1009d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9c4a15cb4e97bc39a3aea8304fb04d56c0d753f2a6b79c83db0a894647ba8de7?d=identicon)[ralphschindler](/maintainers/ralphschindler)

![](https://avatars.githubusercontent.com/u/107836?v=4)[Josh Butts](/maintainers/jimbojsb)[@jimbojsb](https://github.com/jimbojsb)

---

Top Contributors

[![ralphschindler](https://avatars.githubusercontent.com/u/76674?v=4)](https://github.com/ralphschindler "ralphschindler (22 commits)")[![EPGDigital-MW](https://avatars.githubusercontent.com/u/89184006?v=4)](https://github.com/EPGDigital-MW "EPGDigital-MW (3 commits)")[![jimbojsb](https://avatars.githubusercontent.com/u/107836?v=4)](https://github.com/jimbojsb "jimbojsb (1 commits)")[![omar-vasquez-dev](https://avatars.githubusercontent.com/u/45601266?v=4)](https://github.com/omar-vasquez-dev "omar-vasquez-dev (1 commits)")[![recycledbeans](https://avatars.githubusercontent.com/u/13002230?v=4)](https://github.com/recycledbeans "recycledbeans (1 commits)")

---

Tags

laraveloneloginsaml

### Embed Badge

![Health badge](/badges/ziffmedia-laravel-onelogin/health.svg)

```
[![Health](https://phpackages.com/badges/ziffmedia-laravel-onelogin/health.svg)](https://phpackages.com/packages/ziffmedia-laravel-onelogin)
```

###  Alternatives

[kimai/kimai

Kimai - Time Tracking

4.8k9.0k1](/packages/kimai-kimai)[aacotroneo/laravel-saml2

A Laravel package for Saml2 integration as a SP (service provider) for multiple IdPs, based on OneLogin toolkit which is much more lightweight than simplesamlphp.

5694.7M](/packages/aacotroneo-laravel-saml2)[pantheon-systems/wp-saml-auth

SAML authentication for WordPress, using SimpleSAMLphp.

92269.6k3](/packages/pantheon-systems-wp-saml-auth)[scaler-tech/laravel-saml2

SAML2 Service Provider integration for Laravel applications, based on OneLogin toolkit

282109.9k](/packages/scaler-tech-laravel-saml2)[hslavich/oneloginsaml-bundle

OneLogin SAML Bundle for Symfony

1482.5M1](/packages/hslavich-oneloginsaml-bundle)[humanmade/wp-simple-saml

WordPress Simple SAML plugin

123305.2k5](/packages/humanmade-wp-simple-saml)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
