RefreshTokenStore
RefreshTokenStore
Default DBI-backed Hazaar\OAuth\Interface\RefreshTokenStore implementation.
class RefreshTokenStore implements \Hazaar\OAuth\Interface\RefreshTokenStoreImplements: Hazaar\OAuth\Interface\RefreshTokenStore
Expects a table (default oauth_refresh_tokens) with columns token_hash (primary key), client_id, user_identity, scope (JSON text), resource and expires_at. This implementation does not require or provide a schema migration — any text/varchar/json column types work.
Tokens are hashed with SHA-256 before storage and lookup — the plaintext value is never persisted, the same way a password would be handled.
Configuration (oauth.server.refresh_tokens_options):
database(string|array, optional): passed to Hazaar\DBI\Adapter::create. Defaults to the application's default database connection.table(string, optional): table name. Defaults tooauth_refresh_tokens.
Properties
table
private Table $tableType: Hazaar\DBI\Table
Methods
__construct
public __construct(array|Options $options = 'new Options()'): voidParameters
| Parameter | Type | Description |
|---|---|---|
$options | array | Hazaar\OAuth\Store\DBI\Options |
save
public save(RefreshToken $token): voidReturns: void
Parameters
| Parameter | Type | Description |
|---|---|---|
$token | Hazaar\OAuth\RefreshToken |
consume
public consume(string $token): ?RefreshTokenReturns: Hazaar\OAuth\RefreshToken
Parameters
| Parameter | Type | Description |
|---|---|---|
$token | string |
revoke
public revoke(string $token): voidReturns: void
Parameters
| Parameter | Type | Description |
|---|---|---|
$token | string |
hash
private hash(string $token): stringReturns: string
Parameters
| Parameter | Type | Description |
|---|---|---|
$token | string |
Generated by Hazaar API Doc Generator on Sun, 23 Aug 2026 10:49:43 +0000