TsgcWebSocketProxyServer › 이벤트 › OnNegotiateAuthentication
Kerberos 또는 NTLM(Negotiate) 교환이 완료될 때 발생하므로 애플리케이션이 인증된 주체를 수락하거나 거부할 수 있습니다.
property OnNegotiateAuthentication: TsgcWSNegotiateAuthenticationEvent;
// TsgcWSNegotiateAuthenticationEvent = procedure(Connection: TsgcWSConnection; const aPrincipal: String; var Authenticated: Boolean) of object
—
sgcWebSockets Enterprise Edition이 필요합니다. OnNegotiateAuthentication은 Authentication.Negotiate.Enabled로 시작된 Kerberos 또는 NTLM 교환이 완료될 때 발생합니다. aPrincipal은 인증된 ID이며, Windows에서는 DOMAIN\user, Linux에서는 user@REALM입니다. Authenticated는 True로 전달되므로, 핸들러가 없으면 Windows 또는 Kerberos가 인증한 모든 주체가 수락됩니다. 주체를 거부하려면 False로 설정하십시오. 그러면 클라이언트는 401 응답을 받습니다. Indy 서버에서는 이후 TsgcWSConnectionServer(Connection).Authentication.User로 주체를 읽을 수 있습니다(AuthType은 authNegotiate입니다). Kerberos 및 Negotiate 인증을(를) 참조하십시오.
procedure TForm1.OnNegotiateAuthenticationEvent(Connection: TsgcWSConnection;
const aPrincipal: String; var Authenticated: Boolean);
begin
Authenticated := SameText(aPrincipal, 'EXAMPLE\alice') or
SameText(aPrincipal, 'EXAMPLE\bob');
end;