TsgcWebSocketHTTPServer › Events › OnNegotiateAuthentication
Wordt geactiveerd wanneer een Kerberos- of NTLM-uitwisseling (Negotiate) is voltooid, zodat de toepassing de geauthenticeerde principal kan accepteren of weigeren.
property OnNegotiateAuthentication: TsgcWSNegotiateAuthenticationEvent;
// TsgcWSNegotiateAuthenticationEvent = procedure(Connection: TsgcWSConnection; const aPrincipal: String; var Authenticated: Boolean) of object
—
Vereist sgcWebSockets Enterprise Edition. OnNegotiateAuthentication wordt geactiveerd wanneer de Kerberos- of NTLM-uitwisseling die door Authentication.Negotiate.Enabled is gestart, is voltooid. aPrincipal is de geauthenticeerde identiteit: DOMAIN\user op Windows en user@REALM op Linux. Authenticated komt binnen als True, dus zonder handler wordt elke principal geaccepteerd die door Windows of Kerberos is geauthenticeerd. Stel de parameter in op False om de principal te weigeren; de client ontvangt dan een 401-antwoord. Bij de Indy-servers kan de principal daarna worden uitgelezen als TsgcWSConnectionServer(Connection).Authentication.User (AuthType is authNegotiate). Zie Kerberos- en Negotiate-authenticatie.
procedure TForm1.OnNegotiateAuthenticationEvent(Connection: TsgcWSConnection;
const aPrincipal: String; var Authenticated: Boolean);
begin
Authenticated := SameText(aPrincipal, 'EXAMPLE\alice') or
SameText(aPrincipal, 'EXAMPLE\bob');
end;