HelPHP

Auth
in package

Tags
class

Auth

OID (Origin IDentifier) issue/verify for the MCP HTTP+SSE transport. Deliberately mirrors helPHP\libs\Restresponse::generateOid()/check_oid() -- same hlp_users_token / hlp_users_data tables, same 3-factor fingerprint (token + md5(user-agent) + client identifier, which is the client ip by default but may be a value the client sends itself, see Restresponse::check_ua_and_ip()'s hicut field) -- as a separate, self-contained implementation rather than a call into Restresponse: Restresponse's constructor unconditionally runs its full check_request_data() -> check_ua_and_ip() -> command_route() pipeline, so partial reuse isn't practical without changing that live, security-critical class. If Restresponse's token scheme ever changes, mirror the change here too.

Table of Contents

Methods

issue_oid()  : string
Issues a fresh OID token for a just-authenticated user.
verify_oid()  : array<string|int, mixed>|false
Verifies an OID against the 3-factor fingerprint and loads the caller's identity.

Methods

issue_oid()

Issues a fresh OID token for a just-authenticated user.

public static issue_oid(int $user_id, string $user_agent, string $client_ip) : string
Parameters
$user_id : int
$user_agent : string
$client_ip : string
Return values
string

verify_oid()

Verifies an OID against the 3-factor fingerprint and loads the caller's identity.

public static verify_oid(string $oid, string $user_agent, string $client_ip) : array<string|int, mixed>|false
Parameters
$oid : string
$user_agent : string
$client_ip : string
Return values
array<string|int, mixed>|false —

['user_id'=>int, 'login'=>string, 'admin'=>bool] or false if invalid

On this page

Search results