TsgcHTTP2ClientProperties › Authentication

Authentication Property

Configures the credentials used to authenticate HTTP/2 requests, including OAuth2 and JWT tokens.

Syntax

property Authentication: TsgcHTTP2_Authentication_Options read FAuthentication write SetAuthentication;

Default Value

Enabled=False

Remarks

Set Authentication.Enabled to True and assign one of the supported schemes. Under Token you can link a TsgcHTTP_OAuth_Client component (Token.OAuth) to obtain OAuth2 access tokens or a TsgcHTTP_JWT_Client component (Token.JWT) to obtain JWT credentials. The resulting bearer token is added to the authorization HTTP/2 header of every request. The OnHTTP2Authorization event is fired before the request is sent so the username/password or token can be set on the fly.

Example


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

Back to Properties