Skip to content
Snippets Groups Projects
Commit 057d9607 authored by Reiter, Christoph's avatar Reiter, Christoph :snake:
Browse files

More detailed logging when the token validation fails

In case the token is invalid the client only gets a generic error.
During setting up the stack it would be nice if there was a way
to debug potential errors, so log the causing exception by default.

This includes for example if the issues ID or time is the cause of the error.
parent 304989dc
No related branches found
No related tags found
No related merge requests found
Pipeline #59841 failed
......@@ -47,6 +47,7 @@ class BearerUserProvider implements BearerUserProviderInterface, LoggerAwareInte
try {
$jwt = $validator->validate($accessToken);
} catch (TokenValidationException $e) {
$this->logger->info('Invalid token:', ['exception' => $e]);
throw new AuthenticationException('Invalid token');
}
......@@ -54,6 +55,7 @@ class BearerUserProvider implements BearerUserProviderInterface, LoggerAwareInte
try {
$validator::checkAudience($jwt, $config['required_audience']);
} catch (TokenValidationException $e) {
$this->logger->info('Invalid audience:', ['exception' => $e]);
throw new AuthenticationException('Invalid token audience');
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment