Skip to content

Commit

Permalink
clean(ZMS): logging levels in KeycloakInstance.php
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasAFink authored Jan 24, 2025
1 parent f1c6240 commit 15ebb0b
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions zmsslim/src/Slim/Middleware/OAuth/KeycloakInstance.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function getProvider()

public function doLogin(ServerRequestInterface $request, ResponseInterface $response)
{
\App::$log->error('OIDC login attempt', [
\App::$log->info('OIDC login attempt', [
'event' => 'oauth_login_start',
'timestamp' => date('c')
]);
Expand All @@ -39,7 +39,7 @@ public function doLogin(ServerRequestInterface $request, ResponseInterface $resp
$this->testOwnerData($ownerInputData);

if (\BO\Zmsclient\Auth::getKey()) {
\App::$log->error('Clearing existing session', [
\App::$log->info('Clearing existing session', [
'event' => 'oauth_session_clear',
'timestamp' => date('c')
]);
Expand All @@ -51,7 +51,7 @@ public function doLogin(ServerRequestInterface $request, ResponseInterface $resp
->readPostResult('/workstation/oauth/', $ownerInputData, ['state' => \BO\Zmsclient\Auth::getKey()])
->getEntity();

\App::$log->error('OIDC login successful', [
\App::$log->info('OIDC login successful', [
'event' => 'oauth_login_success',
'timestamp' => date('c')
]);
Expand Down Expand Up @@ -97,7 +97,7 @@ public function writeNewAccessTokenIfExpired()

private function testAccess(AccessToken $token)
{
\App::$log->error('Validating OIDC token', [
\App::$log->info('Validating OIDC token', [
'event' => 'oauth_token_validation',
'timestamp' => date('c')
]);
Expand Down Expand Up @@ -194,7 +194,7 @@ private function testAccess(AccessToken $token)
throw new \BO\Slim\Exception\OAuthFailed();
}

\App::$log->error('Token validation successful', [
\App::$log->info('Token validation successful', [
'event' => 'oauth_token_validation_success',
'timestamp' => date('c')
]);
Expand All @@ -210,14 +210,14 @@ private function testOwnerData(array $ownerInputData)

private function getAccessToken($code)
{
\App::$log->error('Getting access token', [
\App::$log->info('Getting access token', [
'event' => 'oauth_get_token',
'timestamp' => date('c')
]);

try {
$accessToken = $this->provider->getAccessToken('authorization_code', ['code' => $code]);
\App::$log->error('Access token obtained', [
\App::$log->info('Access token obtained', [
'event' => 'oauth_get_token_success',
'timestamp' => date('c')
]);
Expand All @@ -238,7 +238,7 @@ private function getAccessToken($code)

private function writeTokenToSession($token)
{
\App::$log->error('Writing token to session', [
\App::$log->info('Writing token to session', [
'event' => 'oauth_write_token',
'timestamp' => date('c')
]);
Expand All @@ -252,7 +252,7 @@ private function writeTokenToSession($token)

private function writeDeleteSession()
{
\App::$log->error('Deleting session', [
\App::$log->info('Deleting session', [
'event' => 'oauth_delete_session',
'timestamp' => date('c')
]);
Expand All @@ -265,7 +265,7 @@ private function writeDeleteSession()

private function readTokenDataFromSession()
{
\App::$log->error('Reading token from session', [
\App::$log->info('Reading token from session', [
'event' => 'oauth_read_token',
'timestamp' => date('c')
]);
Expand Down

0 comments on commit 15ebb0b

Please sign in to comment.