Building a login manager with C#

  • Thread starter Thread starter Yoni Gibbs
  • Start date Start date
Y

Yoni Gibbs

Hi,

I need to build a "login manager" using C#, for a desktop application.
I am new to .NET, having previously only worked in COM, so please
forgive my ignorance. What I need is a "login manager" application
that runs in the background and keeps the client's connection details
ready for any other application to request, as there will be various
applications (and various instances of the same application) all
needing access to this information. This is all to prevent the user
having to log in every time they launch a new instance of the main app
- we will assume that once they have logged in once, that's them -
they will stay logged in for the duration of their Windows session.

So, the first time the main application requires access to the
back-end database, it will call the login manager, which will ask the
user to log in. The login manager will create a session, and pass it
(or maybe just the credentials) to the main application. The main
application will use this as required, then exit. Next time the user
launches the main application, it will request the session (or
credentials) from the login manager, and since the user has already
logged in, the session will be passed from the login manager to the
main app. Hence the user won't have to log in twice.

Previously, with COM, I would have done this using an out-of-process
ActiveX Exe. But how do I do this with .NET? I think I'll have to
use Remoting and the Singleton Design Pattern, but I'm not sure where
to start. I've managed to get some remoting examples working, but
they works over HTTP, and I don't think this will work on simple
client PCs without a web server. Also, although I can get these
examples working, I haven't managed to get them to reuse just one
instance of a class - a new instance is created every time a client
requests it.

Can anyone point me at any useful links or tutorials, or give some
advice?

Thanks in advance,

Yoni.
 
Back
Top