docs: handle userinfo invalid_token outcomes in callback example

Update SDK example callback and integration guidance to treat UserInfoException as an authorization-state outcome (e.g. subject disabled/inactive scope) and return a clear 403 path.
This commit is contained in:
Andy Dixon
2026-02-26 11:51:29 +00:00
parent 7bb919a0a0
commit 78a18ccfab
2 changed files with 6 additions and 0 deletions
+4
View File
@@ -16,6 +16,7 @@ foreach ($autoloadCandidates as $file) {
}
use BlackWallSDK\BlackWallAuth;
use BlackWall\Auth\Exception\UserInfoException;
$auth = new BlackWallAuth([
'clientId' => '94d228c4-d4c6-4479-9b02-793e6a73e3f2',
@@ -42,6 +43,9 @@ try {
header('Location: /');
exit;
} catch (UserInfoException $e) {
http_response_code(403);
echo 'User info access failed: ' . htmlspecialchars($e->getMessage(), ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
} catch (Throwable $e) {
http_response_code(500);
echo 'Auth failed: ' . htmlspecialchars($e->getMessage(), ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');