TsgcWebSocketServer_HTTPAPI › Olaylar › OnNegotiateAuthentication

OnNegotiateAuthentication Olay

Bir Kerberos veya NTLM (Negotiate) değişimi tamamlandığında tetiklenir, böylece uygulama kimliği doğrulanan principal'ı kabul veya reddedebilir.

Sözdizimi

property OnNegotiateAuthentication: TsgcWSNegotiateAuthenticationEvent;
// TsgcWSNegotiateAuthenticationEvent = procedure(Connection: TsgcWSConnection; const aPrincipal: String; var Authenticated: Boolean) of object

Varsayılan Değer

—

Remarks

sgcWebSockets Enterprise Edition gerektirir. OnNegotiateAuthentication, Authentication.Negotiate.Enabled ile başlatılan Kerberos veya NTLM değişimi tamamlandığında tetiklenir. aPrincipal doğrulanan kimliktir: Windows'ta DOMAIN\user, Linux'ta user@REALM. Authenticated True olarak gelir, bu nedenle işleyici yoksa Windows veya Kerberos tarafından doğrulanan her principal kabul edilir. Principal'ı reddetmek için False yapın; istemci bu durumda 401 yanıtı alır. Indy sunucularında principal sonradan TsgcWSConnectionServer(Connection).Authentication.User olarak okunabilir (AuthType authNegotiate olur). Bkz. Kerberos ve Negotiate kimlik doğrulama.

Örnek


procedure TForm1.OnNegotiateAuthenticationEvent(Connection: TsgcWSConnection;
  const aPrincipal: String; var Authenticated: Boolean);
begin
  Authenticated := SameText(aPrincipal, 'EXAMPLE\alice') or
    SameText(aPrincipal, 'EXAMPLE\bob');
end;

Olaylara Dön