TsgcWebSocketServerProperties › APIKeyManager

APIKeyManager Property

Optional API-key manager component used to validate incoming API keys before accepting a connection.

Syntax

property APIKeyManager: TsgcWSAPIKeyManager read FAPIKeyManager write SetAPIKeyManager;

Default Value

nil

Remarks

Assign an external TsgcWSAPIKeyManager component to centralise API key issuance, rotation and validation across multiple server instances. Once assigned, every incoming client must present a valid key in the request (via header or query parameter) or the connection is refused. This property is compiled only when the SGC_APIKEYMANAGER conditional is defined — available on editions that include the API Key Manager add-on. Leave unassigned to disable key-based admission control.

Example


oServer := TsgcWebSocketServer.Create(nil);
oServer.APIKeyManager := oAPIKeyManager;
oServer.Active := true;

Back to Properties