Release 1.0.1: normalized userinfo and callback helper

This commit is contained in:
Andy Dixon
2026-02-26 09:07:11 +00:00
parent 1c7b7b6717
commit 94c85fc8d5
12 changed files with 403 additions and 45 deletions
+18
View File
@@ -7,6 +7,8 @@ This package provides:
- Code-for-token exchange
- Refresh token exchange
- UserInfo retrieval
- UserInfo normalisation (`email`, `privilege_level`, `role`)
- Unified callback handling helper (`handleCallback`)
- Session helpers for `state` and `code_verifier`
- Typed API (`AuthClient`, `TokenSet`) and specific exception classes
@@ -82,6 +84,19 @@ exit;
For callback handling, see `docs/INTEGRATION_GUIDE.md`.
Minimal callback example:
```php
$result = $client->handleCallback($_GET);
$_SESSION['user'] = [
'email' => $result->user->email,
'privilege_level' => $result->user->privilegeLevel,
'role' => $result->user->role,
];
$_SESSION['access_token'] = $result->tokens->accessToken;
```
## Backwards compatibility
A wrapper class is retained for older integrations:
@@ -98,6 +113,9 @@ This wrapper now delegates to `BlackWall\Auth\AuthClient`.
- `BlackWall\Auth\AuthClient`
- `BlackWall\Auth\TokenSet`
- `BlackWall\Auth\AuthResult`
- `BlackWall\Auth\CallbackResult`
- `BlackWall\Auth\UserInfo`
- `BlackWall\Auth\UserInfoNormalizer`
- `BlackWall\Auth\Http\HttpClientInterface`
- `BlackWall\Auth\Http\CurlHttpClient`
- `BlackWall\Auth\Exception\*`