A Laravel 5.4 package to handle VATSIM authentication

1.2.0 2017-09-27 00:43 UTC


A package for Laravel 5.5 to handle authentication via Vatsim SSO.


  • Composer

    Simply run composer require theomessin/vatauth to install the latest version of this package

  • Laravel Setup

    There are several things that need to be done for this package to work:


    Run the following command to publish the default vatauth.php configuration file:

    php artisan vendor:publish --provider="Theomessin\Vatauth\VatauthServiceProvider"


    Firstly, you will have to change your users table so that it is compatible with the data that Vatsim provides.

    Assuming you have the default create_users_table migration:

    • Remove line 20 (the password attribute) as this is no longer applicable.

    • Replace line 17 (the incremental ID) with a simple integer id attribute and set that to be the primary key of the table:

    • Add the following attributes:



    Vatauth will have to register some authentication routes in order to work. To do this, you should call the Vatauth::routes method within your boot method of your AuthServiceProvider:

    namespace App\Providers;
    use Theomessin\Vatauth\Vatauth;
    use Illuminate\Support\Facades\Gate;
    use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
    class AuthServiceProvider extends ServiceProvider
         * The policy mappings for the application.
         * @var array
        protected $policies = [
            'App\Model' => 'App\Policies\ModelPolicy',
         * Register any authentication / authorization services.
         * @return void
        public function boot()


    Finally, you will have to add the VatsimSynchronisable trait to your User.php model:

    use Theomessin\Vatauth\Traits\VatsimSynchronisable;
    class User extends Authenticatable
        use Notifiable. VatsimSynchronisable;

    Replace the fillable array with the following code:

    protected $fillable = [
        'id', 'name', 'email', 'country', 'region', 'division', 'subdivision',

    Also, make sure you remove the password from the $hidden array.


    Go over the vatauth.php configuration file to see what you should set.

    NB: you should keep your RSA certificate in a storage/app/cert.key file.