Create Basic Slim Authentication

I saw 2 questions on SO and a few google topics, but that didn't help me

Slim provides you with various methods like PUT, GET, POST, etc. I want to implement basic authorization, for example, implemented by many APIs. First question: do I need SSL? (I do not have at present) The second question: how to implement it? since I have to send the username and password in the headers in an encrypted form, and then after that I have to use this authentication in every API call Any help?

+5
source share
2 answers

Slim Authentication XSS Middlewares, HttpBasic. Slim Framework:

https://github.com/codeguy/Slim-Extras/tree/master/Middleware

? :

use \Slim\Slim;
use \Slim\Extras\Middleware\HttpBasicAuth;

$app = new Slim();
$app->add(new HttpBasicAuth('theUsername', 'thePassword'));
+6

SSL, ( API) . , .

- /pwd . , http basic authentication. , SO. , API RESTful ( , "" ).

, , , $app->request->headers()

+1

All Articles