Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4dc08dffc9
|
||
|
|
87b811f716
|
||
|
|
eb4ebb9582
|
||
|
|
6af7813e3d
|
||
|
|
31ff9b287d
|
||
|
|
c9a06e5ada
|
||
|
|
4f007765f4
|
||
|
|
97780eb079
|
||
|
|
ed137b38de
|
No files matched your search
@@ -0,0 +1,2 @@
|
|||||||
|
ALTER TABLE `oauth_tokens`
|
||||||
|
ADD `audience` varchar(255) NOT NULL DEFAULT '';
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
ALTER TABLE `oauth_tokens`
|
||||||
|
DROP `audience`;
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
ALTER TABLE `oauth_clients`
|
||||||
|
MODIFY `client_id` varchar(255) CHARACTER SET ascii COLLATE ascii_bin NOT NULL;
|
||||||
@@ -14,12 +14,13 @@ class AddOAuthClientCommand extends Command
|
|||||||
{
|
{
|
||||||
$this->setName('oauth:add-client')
|
$this->setName('oauth:add-client')
|
||||||
->setDescription('Adding of OAuth client.')
|
->setDescription('Adding of OAuth client.')
|
||||||
|
->addArgument('client-id', InputArgument::OPTIONAL, 'Client ID')
|
||||||
->addArgument('preapproved', InputArgument::OPTIONAL, 'Preapproved');
|
->addArgument('preapproved', InputArgument::OPTIONAL, 'Preapproved');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function execute(InputInterface $input, OutputInterface $output): int
|
public function execute(InputInterface $input, OutputInterface $output): int
|
||||||
{
|
{
|
||||||
$clientId = bin2hex(random_bytes(8));
|
$clientId = $input->getArgument('client-id') ? $input->getArgument('client-id') : bin2hex(random_bytes(8));
|
||||||
$clientSecret = bin2hex(random_bytes(20));
|
$clientSecret = bin2hex(random_bytes(20));
|
||||||
|
|
||||||
$oAuthClient = new OAuthClient();
|
$oAuthClient = new OAuthClient();
|
||||||
@@ -27,7 +28,7 @@ class AddOAuthClientCommand extends Command
|
|||||||
$oAuthClient->setClientSecret($clientSecret);
|
$oAuthClient->setClientSecret($clientSecret);
|
||||||
$oAuthClient->setCreatedDate(new DateTime());
|
$oAuthClient->setCreatedDate(new DateTime());
|
||||||
|
|
||||||
if ($input->hasArgument('preapproved') && $input->getArgument('preapproved')) {
|
if ($input->getArgument('preapproved')) {
|
||||||
$oAuthClient->setPreapproved($input->getArgument('preapproved'));
|
$oAuthClient->setPreapproved($input->getArgument('preapproved'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ class OAuthController
|
|||||||
'iat' => (int)$token->getCreatedDate()->getTimestamp(),
|
'iat' => (int)$token->getCreatedDate()->getTimestamp(),
|
||||||
'nbf' => (int)$token->getCreatedDate()->getTimestamp(),
|
'nbf' => (int)$token->getCreatedDate()->getTimestamp(),
|
||||||
'exp' => (int)$token->getExpiresDate()->getTimestamp(),
|
'exp' => (int)$token->getExpiresDate()->getTimestamp(),
|
||||||
|
'aud' => $clientId,
|
||||||
'nonce' => $token->getNonce()
|
'nonce' => $token->getNonce()
|
||||||
], $this->getUserInfoInternal(
|
], $this->getUserInfoInternal(
|
||||||
$this->userRepository->getById($token->getUserId()),
|
$this->userRepository->getById($token->getUserId()),
|
||||||
|
|||||||
@@ -25,8 +25,8 @@
|
|||||||
@yields('main')
|
@yields('main')
|
||||||
</main>
|
</main>
|
||||||
<footer>
|
<footer>
|
||||||
<p><?= round($__debug_runtime, 0) ?> ms</p>
|
<p><?= round($__debug_runtime, 0) ?> ms</p><!--
|
||||||
<p><span class="bold"><?= $_ENV['APP_NAME'] ?></span> <?= str_replace('Release_', '', VERSION) ?></p><!--
|
--><p><span class="bold"><?= $_ENV['APP_NAME'] ?></span> <?= str_replace('Release_', '', VERSION) ?></p><!--
|
||||||
--><p>© The RVR Contributors <?= (new DateTime(REVISION_DATE))->format('Y') ?></p>
|
--><p>© The RVR Contributors <?= (new DateTime(REVISION_DATE))->format('Y') ?></p>
|
||||||
</footer>
|
</footer>
|
||||||
@endsection
|
@endsection
|
||||||
Reference in new issue
Block a user