Re: Cake 3 Base Authentication without Model

2015-11-28 Thread Rumkuchen
just found a way to solve it :-)
I do not know, if it is the best way to implement and to place it...
The docu 

 helped 
my

created a file "/vendor/cakephp/src/Auth/Basic2Authenticate.php"
(I hope, it does not disappear after update via composer)

getUser($request);
}

public function getUser(Request $request)
{
$username = $request->env('PHP_AUTH_USER');
$pass = $request->env('PHP_AUTH_PW');
if (!is_string($username) || $username === '' || !is_string($pass) 
|| $pass === '') {
return false;
}
if ($username === 'foo' && $pass === "bar") {
return ['User' => $username, 'Password' => $pass];
}
return false;
}

}


Am Samstag, 28. November 2015 10:39:25 UTC+1 schrieb Rumkuchen:
>
> I want to use Basic Authentication without a Model - so I want to verify 
> the credentials in a controller
> Is that possible? I know how to do it with Form-Authentication but not 
> with Basic Authentication.
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Cake 3 Base Authentication without Model

2015-11-28 Thread Rumkuchen
I want to use Basic Authentication without a Model - so I want to verify 
the credentials in a controller
Is that possible? I know how to do it with Form-Authentication but not with 
Basic Authentication.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.