For all of Java's authentication/security API's, there is actually no way of verifying a user's password with the underlying operating system. Shaj is a simple Java library that allows your Java app to verify users with the underlying operating system. Shaj also allows you to check group membership.
Shaj is not an authenication library; it's not a replacement for JAAS, which can use an underlying operating system to authenticate and authorize users as well via the various operating system-specific modules. It's meant for simple validation purposes.
Shaj currently supports Windows and Unix (PAM), and comes with pre-compiled JNI libraries for win32, Linux, Mac OS-X and Solaris. Shaj should work on Java 1.2+ JVM's. Shaj is written in C and Java.
Shaj is licensed under the Apache 2.0 License.
-
Shaj 0.5: Simple Host Authentication for Java (Initial Release) (13 messages)
- Posted by: Matt Quail
- Posted on: April 21 2005 04:44 EDT
Threaded Messages (13)
- Apache 2.0 License by Chris Knoll on April 21 2005 08:24 EDT
- Apache 2.0 License by Matt Quail on April 21 2005 08:58 EDT
- re: Apache 2.0 License by Matt Quail on April 21 2005 09:00 EDT
- Shaj 0.5: Simple Host Authentication for Java (Initial Release) by sean decor on April 21 2005 12:09 EDT
- JAAS by Bruno Antunes on April 21 2005 14:16 EDT
-
re: JAAS by Matt Quail on April 21 2005 07:05 EDT
-
re: JAAS by Kewan Wang on April 21 2005 11:59 EDT
- re: JAAS by Matt Quail on April 22 2005 01:57 EDT
- re: JAAS by Jerry L Smith II on April 22 2005 12:38 EDT
-
re: JAAS by Kewan Wang on April 21 2005 11:59 EDT
-
re: JAAS by Matt Quail on April 21 2005 07:05 EDT
- documentation by Matt Quail on April 21 2005 18:45 EDT
- JAAS by Bruno Antunes on April 21 2005 14:16 EDT
- Shaj 0.5: Simple Host Authentication for Java (Initial Release) by Jonathan Gibbons on April 22 2005 03:53 EDT
- Shaj 0.5: Simple Host Authentication for Java (Initial Release) by Jan Novak on April 22 2005 07:29 EDT
- Shaj 0.5: Simple Host Authentication for Java (Initial Release) by a a on May 01 2005 03:41 EDT
-
Apache 2.0 License[ Go to top ]
- Posted by: Chris Knoll
- Posted on: April 21 2005 08:24 EDT
- in response to Matt Quail
This sounds like a fantastic feature, my question is: Under Apache 2.0 License, if I incorporate this library into my code, does my application now become subject to Apache 2.0 License or do I just need to include the materials to uphold the Apache license for Shaj?
If using Shaj doesn't interfere with how I license my own product, that sounds great.
-Chris -
Apache 2.0 License[ Go to top ]
- Posted by: Matt Quail
- Posted on: April 21 2005 08:58 EDT
- in response to Chris Knoll
The Apache 2.0 License is not "viral" in this way. The last paragraph in section 4 should address you question: http://www.apache.org/licenses/LICENSE-2.0.html
Or to put it another way: as the author of Shaj, I'm more than happy for you to use Shaj in your application :D -
re: Apache 2.0 License[ Go to top ]
- Posted by: Matt Quail
- Posted on: April 21 2005 09:00 EDT
- in response to Chris Knoll
Actually, this sums it up best: http://www.apache.org/foundation/licence-FAQ.html#WhatDoesItMEAN -
Shaj 0.5: Simple Host Authentication for Java (Initial Release)[ Go to top ]
- Posted by: sean decor
- Posted on: April 21 2005 12:09 EDT
- in response to Matt Quail
Some basic documentation as to how to set up and what all classes to use would have been great.
Do you think you will become popolar just like that - by making every user to go thru the source code. ? -
JAAS[ Go to top ]
- Posted by: Bruno Antunes
- Posted on: April 21 2005 14:16 EDT
- in response to sean decor
There are already today JAAS Modules to perform this
Java Authentication and Authorization Service (JAAS)
http://java.sun.com/products/jaas/index.jsp -
re: JAAS[ Go to top ]
- Posted by: Matt Quail
- Posted on: April 21 2005 19:05 EDT
- in response to Bruno Antunes
There are already today JAAS Modules to perform this
Bruno,
If you have working JAAS code that allows you to verify usernames and passwords of arbitrary users (on win32/linux/solaris/osx), I'd love to see it. -
re: JAAS[ Go to top ]
- Posted by: Kewan Wang
- Posted on: April 21 2005 23:59 EDT
- in response to Matt Quail
Matt Quail,
Why can't?
see com.sun.security.auth package. -
re: JAAS[ Go to top ]
- Posted by: Matt Quail
- Posted on: April 22 2005 01:57 EDT
- in response to Kewan Wang
Why can't? see com.sun.security.auth package.
Kewan,
I'd love to be proven wrong, but those com.sun.security.auth classes (NTLoginModule and UnixModule) only retrieve the current user, not any arbitrary user. -
re: JAAS[ Go to top ]
- Posted by: Jerry L Smith II
- Posted on: April 22 2005 12:38 EDT
- in response to Matt Quail
Here you go, for Win32 at least.
http://free.tagish.net/jaas/index.jsp -
documentation[ Go to top ]
- Posted by: Matt Quail
- Posted on: April 21 2005 18:45 EDT
- in response to sean decor
Some basic documentation as to how to set up and what all classes to use would have been great.
Sean, Shaj is easy to setup and use, the documenation is here (it links through to the javadoc):
http://opensource.cenqua.com/shaj/doc.html -
Shaj 0.5: Simple Host Authentication for Java (Initial Release)[ Go to top ]
- Posted by: Jonathan Gibbons
- Posted on: April 22 2005 03:53 EDT
- in response to Matt Quail
Hurrah!
A great idea.
Perfect for app side or web side user authentication I presume?
i.e. an intranet web site where they still enter their passwd, but the server can then use Shaj to check it via the 'NTLM stuff' (been a while since I was involved with this).
Jonathan -
Shaj 0.5: Simple Host Authentication for Java (Initial Release)[ Go to top ]
- Posted by: Jan Novak
- Posted on: April 22 2005 07:29 EDT
- in response to Jonathan Gibbons
Look's nice but is there any possibility how to check password in hash form, which you get from IE when using NTLM auth?
Thanks -
Shaj 0.5: Simple Host Authentication for Java (Initial Release)[ Go to top ]
- Posted by: a a
- Posted on: May 01 2005 03:41 EDT
- in response to Matt Quail
hi, i tried to use Shaj for a practice but it seems that it is not working right to check my local linux computer for proper username and password.<br>
Here is my code from test.java:<br>
import com.cenqua.shaj.Shaj;
public class test{
public static void main(String[] args){
boolean correctPassword = Shaj.checkPassword(null, "john", "test");
if (correctPassword)
System.out.println("Authorized User.");
else
System.out.println("Incorrect UserName/Password.");
}
}//end of test
any ideas why it is not working?<br>
thanks!