dbtedman/laravel-sso-provider

This package is abandoned and no longer maintained. No replacement package was suggested.

Provides custom SSO integration to Laravel 5 applications.

2.0.0 2019-09-03 11:27 UTC

This package is auto-updated.

Last update: 2020-04-12 08:35:09 UTC


README

This project is no longer maintained.

Provides custom SSO integration to Laravel 5 applications.

Where do I start?

Require

Require the dbtedman/laravel-sso-provider package.

composer require dbtedman/laravel-sso-provider

Use

Use the library in your authentication controller.

use DBTedman\SSOProvider\Helpers\SSOHelper;

$sso = SSOHelper::login();

if ($sso->valid() && $sso->isStaffMember) {
  // Assumes you have a method defined elsewhere which returns an existing User object.
  $thisUser = findUserByStaffNumber($sso->staffNumber);

  if ($thisUser == null) {
    // We could not find user so lets create them.
    $thisUser = new User;
    $thisUser->staff_number = $sso->staffNumber;
  }

  // Keep name and email up to date with SSO data for new and existing users.
  $thisUser->full_name = $sso->fullName;
  $thisUser->email = $sso->email;

  // Save any changes made to the user.
  $thisUser->save();

  if ($thisUser != null) {
    // Finish the login using Laravel's Auth facade.
    Auth::login($thisUser, false);
  }
}

Want to lean more?

  • See our Contributing Guide for details on how this repository is developed.
  • See our Changelog for details on which features, improvements, and bug fixes have been implemented
  • See our License for details on how you can use the code in this repository.
  • See our Security Guide for details on how security is considered.