Lidgren, games/apps and authentication

263 views
Skip to first unread message

Nox

unread,
Jul 31, 2017, 5:19:38 AM7/31/17
to lidgren-network-gen3
Hello.

I'm an amateur trying to make an accounting desktop app to use it in my work (sort of accounting), using C#, WPF and MYSQL. For some reasons I need to make a service to pass very simple messages between server and clients, but as I said I'm an amateur and if there's something I don't know almost anything, that's networking.
So I searched and googled and stackoverflowed and found lidgren, which API basically saved me, easy to understand, easy to work with. I managed to make a service to make what I need (I suppose it'll do it, I haven't tested it yet), I still don't know anything about security and authentication, so I started to search again, and here comes problems.
All I have been able to find about this topic with lidgren are related to games, mostly with Unity and XNA. Obviously that's not what I need, but again I have not been able to find anything more. The problem here of course is MY lack of knowledge, I'm well aware of it, but I've managed to get to work like 50% of the app searching and learning (it's not like I'm an absolutely newbie, I took my first steps several yeas ago), but this thing is frustrating me, so here is my first question: is lidgren a library specifically made for games and I'm just not using it like originally intended?

Even if that's the case, I'd like to use it since it's really easy to use and it fits perfectly what I need. Therefore, I don't know if you all use to answer this type of questions, but I'll try it anyway... thing is that all I've been able to find about authentication includes two things: send password hash and check it or use certificates.
I don't like to send the password hash, in the app I remove the pasword hash asap after checking with the DB, which is apart from the service, and I wouldn't like to store the hash in memory all the time to make authentication with the service.
Now, I searched about certificates and found some way to make one programmatically, but what now? Do I have to make a "certificate object", serialize it and send it as a ConnectionApproval message? But how would the service know the certificate is from one of the clients? Does all the client have to make one at installation and send it to te service and store it someway?  :???

As you can see I'm confused with this, I'm used to search and ask and read, I learn how to made things and made them. But this time I've searched and searched (I've asked it at stackoverflow too without results), but again I've found almost nothing not related to games, nothing that even point me in the right direction. And that's what I'm trying, not asking code or anything like that, just tutorials, articles, blogs, Q&A, whatever I can read to learn to deny connections from others than the app clients(of course as well of clients deny connections from others than the server).

I'll appreciate ANY help.

Greetings.

Ken Florentino

unread,
Aug 3, 2017, 10:30:48 PM8/3/17
to lidgren-network-gen3
You might consider something like Nancy (very lightweight HTTP server) that will allow you to create a very simple HTTP service for your server application and use something like RestSharp for your client. You'll find many easy tutorials. For Nancy, you can consider self-hosting (https://github.com/NancyFx/Nancy/wiki/Self-Hosting-Nancy) so that you don't need IIS or another web server.

Lidgren is a UDP networking library intended for use in applications that need very efficient low latency network communication, which of course one would often need in multi-player games. It's definitely not optimal for the use case you describe below, but you could make it work.

Nox

unread,
Aug 4, 2017, 5:01:12 AM8/4/17
to lidgren-network-gen3
I see, so basically it isn't the right library for my case.
I'll start reading about Nancy and RestSharp then, thanks. 

PS: Just 5 minutes after beginning reading I'm finding authentication too. Thanks you very much :)
Reply all
Reply to author
Forward
Message has been deleted
0 new messages