|
9 | 9 | require_once __DIR__ . '/../vendor/autoload.php'; |
10 | 10 |
|
11 | 11 | /*/ The PSR Request and Response objects are usually provided by your framework /*/ |
12 | | -$request = Laminas\Diactoros\ServerRequestFactory::fromGlobals($_SERVER, $_GET, $_POST, $_COOKIE, $_FILES); |
| 12 | +$request = \Laminas\Diactoros\ServerRequestFactory::fromGlobals($_SERVER, $_GET, $_POST, $_COOKIE, $_FILES); |
13 | 13 | $response = new \Laminas\Diactoros\Response(); |
14 | 14 |
|
15 | 15 | /*/ The User (ID) is usually also provided by an entity in your framework /*/ |
|
35 | 35 | $encryptionKey = file_get_contents($keyPath . '/encryption.key'); |
36 | 36 | $privateKey = file_get_contents($keyPath . '/private.key'); |
37 | 37 |
|
38 | | -$config = (new Pdsinterop\Solid\Auth\Factory\ConfigFactory( |
| 38 | +$config = (new \Pdsinterop\Solid\Auth\Factory\ConfigFactory( |
39 | 39 | $clientIdentifier, |
40 | 40 | $clientSecret, |
41 | 41 | $encryptionKey, |
42 | | - $privateKey |
| 42 | + $privateKey, |
43 | 43 | [/* @FIXME: Server config keys go here */] |
44 | 44 | ))->create(); |
45 | 45 |
|
46 | | -$authorizationServer = (new Pdsinterop\Solid\Auth\Factory\AuthorizationServerFactory($config))->create(); |
| 46 | +$authorizationServer = (new \Pdsinterop\Solid\Auth\Factory\AuthorizationServerFactory($config))->create(); |
47 | 47 |
|
48 | 48 | $user = null; |
49 | 49 | if ($userId !== '') { |
50 | | - $user = new Pdsinterop\Solid\Auth\Entity\User(); |
| 50 | + $user = new \Pdsinterop\Solid\Auth\Entity\User(); |
51 | 51 | $user->setIdentifier($userId); |
52 | 52 | } |
53 | 53 |
|
|
61 | 61 | switch ($request->getMethod() . $request->getUri()) { |
62 | 62 | // @CHECKME: Do we also need 'GET/.well-known/oauth-authorization-server'? |
63 | 63 | case 'GET/.well-known/openid-configuration': |
64 | | - $server->respondToWellKnowRequest(); |
| 64 | + $response = $server->respondToWellKnownRequest(); |
65 | 65 | break; |
66 | 66 |
|
67 | 67 | case 'POST/access_token': |
68 | | - $server->respondToAccessTokenRequest($request); |
| 68 | + $response = $server->respondToAccessTokenRequest($request); |
69 | 69 | break; |
70 | 70 |
|
71 | 71 | case 'GET/authorize': |
|
0 commit comments