56 lines
1.2 KiB
PHP
56 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Models\User;
|
|
use Antadis\Auth\Wsse\WsseAuthServiceProvider;
|
|
use Antadis\Security\Wsse\WsseHeaderGenerator;
|
|
|
|
use ApiUser;
|
|
|
|
class AuthServiceProvider extends WsseAuthServiceProvider
|
|
{
|
|
/**
|
|
* Register any application services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function register()
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Boot the authentication services for the application.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function boot()
|
|
{
|
|
if (env('APP_DEBUG') === true) {
|
|
$this->app['auth']->viaRequest('api', function ($request) {
|
|
//BRICO USER 2553994 (latour@antadis.com)
|
|
//BBB USER 952478 (marion@antadis.com)
|
|
$user = new ApiUser(952478);
|
|
if (\Validate::isLoadedObject($user)) {
|
|
return $user;
|
|
} else {
|
|
return null;
|
|
}
|
|
});
|
|
} else {
|
|
parent::boot();
|
|
}
|
|
|
|
}
|
|
|
|
/**
|
|
* Return the digester
|
|
*
|
|
* @return Antadis\Security\Wsse\Digester
|
|
*/
|
|
protected function getDigester() {
|
|
return new Digester();
|
|
}
|
|
}
|