Reputation: 7352
I'm working on a server written in Java, and a client (a desktop application written in .Net) that runs on Windows machines on the same network. I would like to have some basic authentication so that the server can determine the username of the user running the client, without needing the user to re-enter their Windows password in the client.
Is this possible, and what's the simplest way to accomplish it?
I had a look at some of the available APIs, it looks as though the org.ietf.jgss package in Java, and NegotiateStream class in .Net, should probably be able to talk to one another to achieve this - but I keep hitting frustrating error messages I don't understand. I thought I'd check if this is the right approach, if so I'll post a separate question with more detail about the errors in question :)
Upvotes: 4
Views: 525
Reputation: 249
This open source library http://spnego.sourceforge.net has exactly what you are looking for. It implements an HTTP Servlet Filter on the server so that your web-app can call request.getRemoteUser() to find out the username.
Upvotes: 0
Reputation: 5470
Not being familiar with the GSS mechanism. I would suggest a shared key mechanism used in passwordless ssh.
Upvotes: 0
Reputation: 127467
The approach is the right one. Notice a number of things, though:
Upvotes: 3
Reputation: 308763
If you're using Active Directory, I think the Spring LDAP module can offer you a nice way to access credentials.
Upvotes: 0