Java Mailing List Archive

http://www.junlu.com/

Google
Google
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
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
ServiceUnavailableException for NIS authentication using JNDI and JAAS

ServiceUnavailableException for NIS authentication using JNDI and JAAS

2004-07-11       - By Yaron Gvili

 Back
Reply:     1     2  

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 Source code of 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 Source code of javax.security.auth.AuthPermission
                   "createLoginContext.TesterJaas";
};

grant codebase "file:./nis.jar" {
permission
java.net.SocketPermission Source code of java.net.SocketPermission "starlight.tau.ac.il", "connect";

permission
java.net.SocketPermission Source code of 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".

©2008 junlu.com - Jax Systems, LLC, U.S.A.