TsgcHTTP2ClientProprietà › Authentication

Authentication Proprietà

Configura le credenziali utilizzate per autenticare le richieste HTTP/2, inclusi i token OAuth2 e JWT.

Sintassi

property Authentication: TsgcHTTP2_Authentication_Options read FAuthentication write SetAuthentication;

Valore predefinito

Enabled=False

Note

Impostare Authentication.Enabled a True e assegnare uno degli schemi supportati. In Token è possibile collegare un componente TsgcHTTP_OAuth_Client (Token.OAuth) per ottenere token di accesso OAuth2 oppure un componente TsgcHTTP_JWT_Client (Token.JWT) per ottenere credenziali JWT. Il token bearer risultante viene aggiunto all'intestazione HTTP/2 authorization di ogni richiesta. L'evento OnHTTP2Authorization viene attivato prima dell'invio della richiesta, consentendo di impostare nome utente/password o token al volo.

Esempio


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

Torna alle Proprietà