# gnexus/auth-client

Private framework-agnostic PHP client library for integrating services with `gnexus-auth`.

## Status

Early scaffold with working core pieces.

Current scaffold includes:

- package metadata;
- PSR-oriented dependency boundaries;
- high-level `GAuthClient`;
- configuration object;
- DTO set;
- storage and service contracts;
- exception family;
- PKCE and authorization URL helpers.
- HTTP token endpoint client;
- HTTP userinfo client;
- webhook HMAC verifier;
- webhook JSON parser;
- package-level unit tests;
- plain PHP integration example.

This package is intended to be extracted into a separate private repository.

## Current Path

Temporary local development path:

```text
packages/auth-client
```

## Usage Shape

The package is designed around one high-level client:

```php
GNexus\GAuth\Client\GAuthClient
```

It expects:

- `GAuthConfig`
- token endpoint implementation
- runtime user provider
- webhook verifier
- webhook parser
- state store
- PKCE store

## Example

A plain PHP integration example is included at:

```text
examples/plain-php
```

It shows:

- redirect to `gnexus-auth`
- callback exchange
- userinfo fetch
- webhook verification and parsing
- session-backed example stores

A Composer consumer example is included at:

```text
examples/consumer-template
```

It shows:

- private `vcs` repository wiring
- package requirement
- one practical set of PSR implementations for HTTP and message factories

## Extraction

This package is meant to be moved into a dedicated private repository.

See:

- `examples/plain-php/README.md`
- `EXTRACTION.md`
