  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Struts - A MVC web framework | | Tomcat - JSP/Servlet container | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | | JSP - A mailing list about Java Server Pages specification and reference | |
Struts & Hibernate
|
|
|
  | | | ServiceUnavailableException for NIS authentication using JNDI and JAAS | ServiceUnavailableException for NIS authentication using JNDI and JAAS 2004-07-11 - By Yaron Gvili
Back Hello, all.
I'm trying to set up NIS authentication by following the JAAS authentication tutorial at http://java.sun.com/j2se/1.4.2/docs/guide/security/jgss/tutorials/AcnOnly.h tml and the JndiLoginModule instruction at http://java.sun.com/j2se/1.4.2/docs/guide/security/jaas/spec/com/sun/securi ty/auth/module/JndiLoginModule.html
After a few seconds of waiting for the user and password I typed to authenticate, I get the following output:
[JndiLoginModule] user provider: nis://starlight.tau.ac.il/taucc.tau.ac.il/user [JndiLoginModule] group provider: nis://starlight.tau.ac.il/taucc.tau.ac.il/system/group [JndiLoginModule]: User not found javax.naming.ServiceUnavailableException : starlight.tau.ac.il for taucc.tau.ac.il not responding at com.sun.jndi.nis.NISInitCtx.init(NISInitCtx.java:144) ... [JndiLoginModule] regular authentication failed [JndiLoginModule]: aborted authentication failed
However, I managed to obtain a user record (without a security manager) using the sample code at http://www.geocities.com/aacesta/nis.html
Here are some technical details. I'm using Windows XP, J2SDK 1.4.2_04 and NIS 1.2.1
My JAAS configuration file "jaas.conf":
TesterJaas { com.sun.security.auth.module.JndiLoginModule required debug=true user.provider.url="nis://starlight.tau.ac.il/taucc.tau.ac.il/user" group.provider.url="nis://starlight.tau.ac.il/taucc.tau.ac.il/system/group" ; };
My security policy file "security.policy":
grant codebase "file:./main.jar" { permission javax.security.auth.AuthPermission  "createLoginContext.TesterJaas"; };
grant codebase "file:./nis.jar" { permission java.net.SocketPermission "starlight.tau.ac.il", "connect";
permission java.net.SocketPermission "starlight.tau.ac.il", "resolve"; };
The main class is packaged in "main.jar". The NIS provider jars "nis.jar" and "providerutil.jar" are added to the classpath. The JVM properties I used are:
-Djava.security.manager -Djava.security.policy=security.policy - Djava.security.auth.login.config=jaas.conf - Djava.naming.factory.initial=com.sun.jndi.nis.NISCtxFactory - Djava.naming.provider.url=nis://starlight.tau.ac.il/taucc.tau.ac.il
Yaron.
=========================================================================== To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@(protected) and include in the body of the message "help".
|
|
 |