Help with User/Password in Slim Project

Hello, my name is Iván. I’m new in Slim and PHP, I’m triyng to make a Token generator to access a page.

<?php
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\Factory\AppFactory;

require __DIR__ . '/../vendor/autoload.php';

$app = AppFactory::create();
$app->setBasepath ('/prueba/public');

$app->get('/', function (Request $request, Response $response, $args) {
    $response->getBody()->write("Hola Mundo!");
    return $response;
});


$app->run();

That’s my “Hello World” page.
I need to create a User and Password credentials and then verify it on the code above.

Can anyone help me with this project please?

How much time do you have, and how much do you care? Can you evaluate your php skills, lets say from 0 to 10?