Contents
How to do simple authentication on a TCP server?
So far it does work (although I’m almost sure there are better ways to do this), and next it should write ‘password: ‘ so you could type in your password, and if it’s the right one, it should then validate the credentials and do more stuff…
Do you have to tell the server if authentication is successful?
After that I have to tell the server if the authentication was successful or not. Ok, this won’t work becouse anyone who connect to the socket the server is reading and send a “authentication ok” will be logged on. The other option is to send the password’s has to the server.
How does a TCP server write to a socket?
I wanted the tcp server to write to the socket ‘username: ‘ so you can then type in your username (on a tcp client like netcat or telnet), and then the tcp server must treat that next data as a username.
Can you use SSL on top of TCP?
The SSL/TLS should be used for this, however these protocols lie on top of TCP, so you might need another solution (in common, you need to have a trusted certificate source, need to validate the server cert, need to generate a common symmetric encryption key and then encrypt all data you send).
How to authenticate A Socket.IO server instance?
You just need to call it with two parameters: your Socket.io server instance and an options object. Inside of that options object you pass it an authenticate function which accepts a potential client, any data that client passed to the authenticate event, and a callback to call with the results of your authentication process.
Which is TCP ports does a workstation use to authenticate to?
If you want to find out the exact ports being used, your best bet is to use Netmon or Wireshark to capture the traffic from boot to logon and you can see what ports it’s using. And to add to the list you originally posted, you would need to remove TCP 1024-65535, and add UDP 1024-5000, and UDP 49152-65535 for the emepheral (service response) ports.