Skip to content

Commit e6b94d6

Browse files
Hello-world version of /.well-knonwn/openid-configuration
1 parent f751c95 commit e6b94d6

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace Pdsinterop\Solid\Controller;
4+
5+
use Psr\Http\Message\ResponseInterface;
6+
use Psr\Http\Message\ServerRequestInterface;
7+
8+
class OpenidController extends AbstractController
9+
{
10+
final public function __invoke(ServerRequestInterface $request, array $args): ResponseInterface
11+
{
12+
$response = $this->getResponse();
13+
14+
$response->getBody()->write('<h1>Hello, Openid!</h1>');
15+
16+
return $response;
17+
}
18+
}

web/index.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use Pdsinterop\Solid\Controller\HttpToHttpsController;
2222
use Pdsinterop\Solid\Controller\Profile\CardController;
2323
use Pdsinterop\Solid\Controller\Profile\ProfileController;
24+
use Pdsinterop\Solid\Controller\OpenidController;
2425
use Psr\Http\Message\ResponseInterface;
2526
use Psr\Http\Message\ServerRequestInterface;
2627

@@ -73,6 +74,7 @@
7374
HelloWorldController::class,
7475
HttpToHttpsController::class,
7576
ProfileController::class,
77+
OpenidController::class
7678
];
7779

7880
$traits = [
@@ -114,6 +116,7 @@
114116
$router->map('GET', '/profile/', ProfileController::class)->setScheme($scheme);
115117
$router->map('GET', '/profile/card', CardController::class)->setScheme($scheme);
116118
$router->map('GET', '/profile/card{extension}', CardController::class)->setScheme($scheme);
119+
$router->map('GET', '/.well-known/openid-configuration', OpenidController::class)->setScheme($scheme);
117120

118121
try {
119122
$response = $router->dispatch($request);

0 commit comments

Comments
 (0)