diff --git a/appexemplo_v2.0/api/api_controllers/Authentication.class.php b/appexemplo_v2.0/api/api_controllers/Authentication.class.php index 01288dad..6e81de31 100644 --- a/appexemplo_v2.0/api/api_controllers/Authentication.class.php +++ b/appexemplo_v2.0/api/api_controllers/Authentication.class.php @@ -8,10 +8,13 @@ class Authentication { private $urlChamada = null; private $listPath = array(); + private $listPathIgnore= array(); public function __construct($urlChamada) { $this->urlChamada = $urlChamada; + $this->listPathIgnore[] = $urlChamada.'api'; + $this->listPathIgnore[] = $urlChamada.'sysinfo'; } public function getUrlbase(){ @@ -30,6 +33,10 @@ public function addPath($path){ $this->listPath[] = $this->getUrlbase().$path; } + public function getArrayPathIgnore(){ + return $this->listPathIgnore; + } + /** * Cria um autenticaĆ§Ć£o basica * @@ -42,7 +49,7 @@ public function basicAuth(): HttpBasicAuthentication { return new HttpBasicAuthentication([ 'path' => $this->getArrayPath() - ,'ignore'=> [$this->getUrlbase().'/api', $this->getUrlbase().'/sysinfo'] + ,'ignore'=> $this->getArrayPathIgnore() ,"users" => [ "root" => "teste123" ]