Compare commits

...
Author SHA1 Message Date
bence 4dc08dffc9 Merge pull request 'feature/fix-oauth-audience' (!16) from feature/fix-oauth-audience into master
rvr-nextgen/pipeline/head This commit looks good
Reviewed-on: #16
2023-04-12 02:11:53 +02:00
bence 87b811f716 client id can be anything
rvr-nextgen/pipeline/pr-master This commit looks good
2023-04-12 02:10:33 +02:00
bence eb4ebb9582 send clientId as aud 2023-04-12 02:05:44 +02:00
bence 6af7813e3d drop audience from oauth_tokens 2023-04-12 02:04:56 +02:00
bence 31ff9b287d Revert "add aud to jwt"
This reverts commit 97780eb079.
2023-04-12 02:03:15 +02:00
bence c9a06e5ada Merge pull request 'add aud to jwt' (!15) from feature/add-oauth-audience into master
rvr-nextgen/pipeline/head This commit looks good
Reviewed-on: #15
2023-04-12 00:44:52 +02:00
bence 4f007765f4 Merge pull request 'omit whitespace in main layout' (!14) from bugfix/layout-fix into master
rvr-nextgen/pipeline/head This commit looks good
Reviewed-on: #14
2023-04-12 00:42:40 +02:00
bence 97780eb079 add aud to jwt
rvr-nextgen/pipeline/pr-master This commit looks good
2023-04-12 00:41:20 +02:00
bence ed137b38de omit whitespace in main layout
rvr-nextgen/pipeline/pr-master This commit looks good
2023-04-09 03:16:45 +02:00
6 changed files with 12 additions and 4 deletions

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;
+3 -2
View File
@@ -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'));
} }
+1
View File
@@ -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()),
+2 -2
View File
@@ -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>&copy; The RVR Contributors <?= (new DateTime(REVISION_DATE))->format('Y') ?></p> --><p>&copy; The RVR Contributors <?= (new DateTime(REVISION_DATE))->format('Y') ?></p>
</footer> </footer>
@endsection @endsection