TsgcWebSocketServer › Properties › APIKeyManager
Optional API-key manager component used to validate incoming API keys before accepting a connection.
property APIKeyManager: TsgcWSAPIKeyManager read FAPIKeyManager write SetAPIKeyManager;
nil
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.
oServer := TsgcWebSocketServer.Create(nil);
oServer.APIKeyManager := oAPIKeyManager;
oServer.Active := true;