2017 © Pedro Peláez
 

library laravel-b24-auth-guzzle

Bitrix24 laravel Oauth middleware on Guzzle

image

zedsh/laravel-b24-auth-guzzle

Bitrix24 laravel Oauth middleware on Guzzle

  • Monday, July 31, 2017
  • by zedsh
  • Repository
  • 1 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 17 % Grown

The README.md

laravel-bitrix24-guzzle

This is middleware for lavarel that ensures the user has bitrix24 authorization token., (*1)

Features

Two step auth, (*2)

Check expires, (*3)

Refresh User Data on 2 step of auth, (*4)

Check auth, (*5)

Installation

Step 1., (*6)

In .env:, (*7)

B24_HOSTNAME=https://[yourhostname].bitrix24.ru, (*8)

B24_CLIENT_ID=, (*9)

B24_CLIENT_SECRET=, (*10)

Step 2. In app/Http/Kernel.php:, (*11)

protected $routeMiddleware = [
    'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
    'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
    'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
    'can' => \Illuminate\Auth\Middleware\Authorize::class,
    'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
    'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
    //ADD THIS ->
    'b24auth'=>\zedsh\laravel\B24\Auth::class,
];

Step 3. In routes/web.php:, (*12)

//Add middleware with param 'two' in root of site - two step of auth work over this.
Route::get('/', 'HomeController@index')->name('root page')->middleware('b24auth:two');
//Add middleware with param 'init' in both route of site, and step 1 auth work on this route. After auth work redirect to root and work step two.
Route::get('/b24_state', 'HomeController@getB24State')->name('b24_state')->middleware('b24auth:init');

For refresh user

In app/User.php:, (*13)

//Add Method in User class:, (*14)

public function B24Refresh()
{
Auth::user()->update(['b_user_id'=>$this->B24Creds()->user_id]);
}

The Versions

31/07 2017

dev-master

9999999-dev

Bitrix24 laravel Oauth middleware on Guzzle

  Sources   Download

MIT

The Requires

 

by Eduard Zaboev

31/07 2017

2.0.0

2.0.0.0

Bitrix24 laravel Oauth middleware on Guzzle

  Sources   Download

MIT

The Requires

 

by Eduard Zaboev

28/07 2017

1.0.1

1.0.1.0

Bitrix24 laravel Oauth middleware on Guzzle

  Sources   Download

MIT

The Requires

 

by Eduard Zaboev

28/07 2017

1.0.0

1.0.0.0

Bitrix24 laravel Oauth middleware on Guzzle

  Sources   Download

MIT

The Requires

 

by Eduard Zaboev