ln / nfon_sso
PHP port of the go-nfon-sso OAuth client for nfon SSO portals.
0.1.2
2026-11-02 09:31 UTC
Requires
- php: >=8.3
- guzzlehttp/guzzle: ^7.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
This is a PHP port of the Go OAuth client for nfon SSO login flows.
Installation
cd php
composer install
Usage
<?php require __DIR__ . '/vendor/autoload.php'; use ln\NfonSso\Client; $client = new Client('https://admin.nfon.com', 'admin-portal'); $client->setUser('username', 'password', 'OTPSECRET'); $client->auth(); $token = $client->getToken(); $response = $client->getPortalApi('my-client', 'https://admin.nfon.com/api/endpoint', [], []); print_r($response);
Supported features
- login flow with Keycloak + optional OTP
- token refresh and persistence to JSON
- API GET/POST/PUT/PATCH/DELETE helpers
- file upload helper
- token validation and refresh before expiry
Notes
The port follows the same authentication flow as the Go implementation, including PKCE and TOTP generation for the login challenge.