oauth2 discovery per draft-ietf-oauth-discovery-10

This commit is contained in:
zotlabs 2018-05-21 19:25:03 -07:00
parent 9bf26cee6d
commit 2b3f931c85
2 changed files with 32 additions and 1 deletions

View File

@ -0,0 +1,23 @@
<?php
namespace Zotlabs\Module;
class Oauthinfo extends \Zotlabs\Web\Controller {
function init() {
$ret = [
'issuer' => z_root(),
'authorization_endpoint' => z_root() . '/authorize',
'token_endpoint' => z_root() . '/token',
'response_types_supported' => [ 'code', 'code token' ]
];
json_return_and_die($ret);
}
}

View File

@ -50,7 +50,15 @@ class Well_known extends \Zotlabs\Web\Controller {
$module = new \Zotlabs\Module\Hostxrd();
$module->init();
break;
case 'oauth-authorization-server':
\App::$argc -= 1;
array_shift(\App::$argv);
\App::$argv[0] = 'oauthinfo';
$module = new \Zotlabs\Module\Oauthinfo();
$module->init();
break;
case 'dnt-policy.txt':
echo file_get_contents('doc/dnt-policy.txt');
killme();