Back to product page

LoginPubkey event


Fires when user wants to authenticate to the server with public key

Syntax

  • Basic
Private Sub object_LoginPubkey(User, Login, PublicKey, Action)    
The LoginPubkey(object,User,Login,PublicKey,Action) syntax has these parts:
objectA wodSSHD object.
UserA SSHUser object. Reference to object that holds information about the connected user.
LoginA String value. Holds login info entered by the user.
PublicKeyA String value. Holds public key information provided by the user.
ActionA SSHActions enumeration, as described in settings. Return variable you should set to Allow or Deny, depending if you will allow or deny access for the user.

Remarks

The settings for Action are:

Constant Value Description
Deny0 Deny execution of the action.
Allow 1 Allow to execute action.


LoginPubkey event is fired when the client connects and tries to authenticate with the server. Since wodSSHServer does not have or keep any kind of database about users, you should test login and publickey to determine if you will allow client to connect or not. Typically, you will check this information against some database or file, and set Action variable to Allow - if access is allowed, or Deny - if access is NOT allowed. Make sure you also read about LoginPassword event that is fired when user provides password instead of public key.

When client provides public key, wodSSHServer will check if signature that client provided matches his public key (which he provided in this connection). This may be security leak - he provides public key, he provides signature. Well - at this point LoginPubkey event is fired so you can check if his public key matches one you have in your database (or some locally stored file). If public key is known - let user in.

Platforms

Windows