TsgcWebSocketHTTPServer › Zdarzenia › OnNegotiateAuthentication
Wywoływane po zakończeniu wymiany Kerberos lub NTLM (Negotiate), aby aplikacja mogła zaakceptować lub odrzucić uwierzytelniony podmiot zabezpieczeń.
property OnNegotiateAuthentication: TsgcWSNegotiateAuthenticationEvent;
// TsgcWSNegotiateAuthenticationEvent = procedure(Connection: TsgcWSConnection; const aPrincipal: String; var Authenticated: Boolean) of object
—
Wymaga sgcWebSockets Enterprise Edition. OnNegotiateAuthentication jest wywoływane po zakończeniu wymiany Kerberos lub NTLM rozpoczętej przez Authentication.Negotiate.Enabled. aPrincipal to uwierzytelniona tożsamość: DOMAIN\user w systemie Windows i user@REALM w systemie Linux. Authenticated ma na wejściu wartość True, więc bez procedury obsługi akceptowany jest każdy podmiot uwierzytelniony przez Windows lub Kerberos. Ustaw go na False, aby odrzucić podmiot; klient otrzyma wówczas odpowiedź 401. W serwerach Indy podmiot można później odczytać jako TsgcWSConnectionServer(Connection).Authentication.User (AuthType ma wartość authNegotiate). Zobacz Uwierzytelnianie Kerberos i Negotiate.
procedure TForm1.OnNegotiateAuthenticationEvent(Connection: TsgcWSConnection;
const aPrincipal: String; var Authenticated: Boolean);
begin
Authenticated := SameText(aPrincipal, 'EXAMPLE\alice') or
SameText(aPrincipal, 'EXAMPLE\bob');
end;