Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

eventTstCustomKeyIndexSSHUserName.OnGetUserName

property OnGetUserName: tGetUserNameEvent read fOnGetUserName write SetOnGetUserName;
OnGetUserName is the application-supplied hook DoGetUsername calls whenever the key carries no SSH2 "Subject" header. If the key wraps a certificate its commonName is used to pre-fill the username first, then this event is fired (when assigned) with that value passed by reference, so the handler can either supply a username from scratch or override the commonName-derived one. Implement it to compute the username for a given key, most commonly on the SSH server side where this index maps an incoming authentication username to one of the server's authorized keys; a non-empty result is then cached back onto the key's header (as a Subject value) so the event is not fired again for that key.