TsgcHTTP2ClientEigenschappen › Authentication

Authentication Eigenschap

Configureert de referenties die worden gebruikt om HTTP/2-verzoeken te authenticeren, inclusief OAuth2- en JWT-tokens.

Syntaxis

property Authentication: TsgcHTTP2_Authentication_Options read FAuthentication write SetAuthentication;

Standaardwaarde

Enabled=False

Opmerkingen

Stel Authentication.Enabled in op True en wijs een van de ondersteunde schema's toe. Onder Token kunt u een TsgcHTTP_OAuth_Client-component koppelen (Token.OAuth) om OAuth2 access-tokens te verkrijgen of een TsgcHTTP_JWT_Client-component (Token.JWT) om JWT-credentials te verkrijgen. Het resulterende bearertoken wordt toegevoegd aan de authorization-HTTP/2-header van elk verzoek. Het OnHTTP2Authorization-event wordt geactiveerd voordat het verzoek wordt verzonden, zodat de username/wachtwoord of het token ter plekke kan worden ingesteld.

Voorbeeld


oHTTP2 := TsgcHTTP2Client.Create(nil);
oHTTP2.Host := 'http2.akamai.com';
oHTTP2.Port := 443;
oHTTP2.TLS := True;
oHTTP2.Authentication.Enabled := True;
oHTTP2.Authentication.Token.OAuth := oOAuthClient;

Terug naar Properties