2017 © Pedro Peláez
 

laravel-package laravault-auth

Package for authenticating Laravel against Hashicorp's Vault.

image

codybuell/laravault-auth

Package for authenticating Laravel against Hashicorp's Vault.

  • Friday, August 18, 2017
  • by codybuell
  • Repository
  • 2 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Laravault-Auth

Laravel package for using Hashicorp's Vault as an Authentication Provider. Authenticates users against an instance of Vault, stores user information in the session, and handles closing of the laravel session when the vault ttl expires. Built and tested with Laravel 5.4., (*1)

Installation

  1. Install the LaravaultAuth package manually or with composer:
  • Composer, (*2)

    composer require codybuell/laravault-auth, (*3)

  • Manually, (*4)

    ``` git clone https://github.com/codybuell/laravault-auth.git vendor/codybuell/laravault-auth, (*5)

    # edit composer.json, under autoload -> psr-4 append:, (*6)

    "CodyBuell\LaravaultAuth\": "vendor/codybuell/laravault-auth/src" ```, (*7)

  1. Add provider to config/app.php providers array:, (*8)

    CodyBuell\LaravaultAuth\LaravaultAuthServiceProvider::class,
  2. Publish config and configure config/laravault-auth.php:, (*9)

    php artisan vendor:publish
  3. Set 'vault' as your auth provider in config/auth.php:, (*10)

    'providers' => [
        'users' => [
            'driver' => 'vault',
        ],
    ]
  4. Set auth to use username rather than email. In app/Http/Controllers/Auth/LoginController.php add:, (*11)

    /**
     * Use usernames instead of emails.
     */
    public function username() {
      return 'username';
    }

Usage

Accessing Vault Client Token

Accessing User Attributes

Todo

  • write tests
  • add option to not tie laravel session length to vault ttl

The Versions

18/08 2017

dev-master

9999999-dev

Package for authenticating Laravel against Hashicorp's Vault.

  Sources   Download

MIT

The Requires

 

by Avatar codybuell

laravel authentication vault