Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't log in to new installation #15

Closed
GoogleCodeExporter opened this issue Mar 16, 2015 · 13 comments
Closed

Can't log in to new installation #15

GoogleCodeExporter opened this issue Mar 16, 2015 · 13 comments

Comments

@GoogleCodeExporter
Copy link

Hi there, I can't login to my new OKS 4.0.5 installation.
This is my configuration:

$ java -version
java version "1.6.0_13"
Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
Java HotSpot(TM) 64-Bit Server VM (build 11.3-b02, mixed mode)

$ echo $CLASSPATH
.:/home/ontopia/webdir/oks-enterprise-4.0.5/lib/oks-enterprise.jar:/home/
ontopia/webdir/oks-enterprise-4.0.5/apache-tomcat/common/lib/servlet-
api.jar:/home/ontopia/webdir/oks-enterprise-4.0.5/apache-tomcat/common/lib/
jsp-api.jar:/home/ontopia/webdir/oks-enterprise-4.0.5/apache-tomcat/common/
lib/standard.jar:/home/ontopia/webdir/oks-enterprise-4.0.5/apache-tomcat/
common/lib/jstl.jar:/home/ontopia/webdir/oks-enterprise-4.0.5/apache-
tomcat/server/lib/oks-realm.jar

This was initialized in .bashrc.
All files refered to in the CLASSPATH do actually exist.

changed webapps/omnigator/WEB-INF/topicmaps/userman.ltm
added:

[bock : user = "Benjamin Bock"]
{bock, username, [[bock]]}
{bock, password, [[okgoohno]]}
plays-role(bock : user, gold-users : role)
plays-role(bock : user, ontopoly-users : role)

(neither bock nor johndoe worked)

also changed "users" to "gold-users" in webapps/accessctl/WEB-INF/web.xml, 
neither user nor gold-users worked for bock nor johndoe

76     <auth-constraint>
77       <role-name>gold-users</role-name>
78     </auth-constraint>
and
90   <security-role>
91     <role-name>gold-users</role-name>
92   </security-role>


The Stacktrace from logs/tomcat.log:
WARN 2009-05-23 13:44:46,315 realm.JAASRealm - Login exception 
authenticating username "bock"
 javax.security.auth.login.LoginException: unable to find LoginModule 
class: net.ontopia.topicmaps.nav2.realm.TMLoginModule
        at javax.security.auth.login.LoginContext.invoke
(LoginContext.java:808)
        at javax.security.auth.login.LoginContext.access
$000(LoginContext.java:186)
        at javax.security.auth.login.LoginContext$4.run
(LoginContext.java:683)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.login.LoginContext.invokePriv
(LoginContext.java:680)
        at javax.security.auth.login.LoginContext.login
(LoginContext.java:579)
        at org.apache.catalina.realm.JAASRealm.authenticate
(JAASRealm.java:366)
        at org.apache.catalina.authenticator.FormAuthenticator.authenticate
(FormAuthenticator.java:258)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke
(AuthenticatorBase.java:417)
        at org.apache.catalina.core.StandardHostValve.invoke
(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke
(ErrorReportValve.java:117)
        at org.apache.catalina.core.StandardEngineValve.invoke
(StandardEngineValve.java:108)
        at org.apache.catalina.connector.CoyoteAdapter.service
(CoyoteAdapter.java:174)
        at org.apache.coyote.http11.Http11Processor.process
(Http11Processor.java:875)
        at org.apache.coyote.http11.Http11BaseProtocol
$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
(PoolTcpEndpoint.java:528)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt
(LeaderFollowerWorkerThread.java:81)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run
(ThreadPool.java:689)
        at java.lang.Thread.run(Thread.java:619)

Original issue reported on code.google.com by lar...@gmail.com on 18 Jun 2009 at 1:27

@GoogleCodeExporter
Copy link
Author

LMG wrote (per Mail):
[...] Are you sure you want to use the topic map to store user information, 
though?
You can use any authentication module you want to. Ontopia doesn't require you 
to use
this particular one. 

---

Which is the prefered way to do authentication with Ontopia? It would be nice 
if some
way of authentication worked out of the box.

Original comment by bnjmn...@gmail.com on 18 Jun 2009 at 1:33

@GoogleCodeExporter
Copy link
Author

There is no preference. Usually, customers have their own requirements (like 
Windows 
Domains or whatever), and so we've gone with that. The Topic Maps realm have 
been 
used for some customers who don't have anything pre-existing.

I agree that this realm *should* work out of the box. So this is a bug that 
needs to 
be fixed. However, we can't do it right now, because we're working on getting 
the 
project set up. In cases like that I always try to propose a workaround for the 
user 
in the meantime. In your case, the workaround is to use some other 
authentication 
method. :)

But we *will* fix this.

Original comment by lar...@gmail.com on 18 Jun 2009 at 1:39

@GoogleCodeExporter
Copy link
Author

The TM-realm used to be the default out of the box, provided in the 
oks-realm.jar
located in the apache-tomcat/server/lib directory. A quick fix that helped me 
out was
copying the jar from an older OKS version. 

Original comment by qsieb...@gmail.com on 7 Jul 2009 at 9:03

@GoogleCodeExporter
Copy link
Author

From what I can see the ontopia-realm.jar is part of the new Ontopia 5.0.0b2 
release: ontopia-5.0.0b2/apache-tomcat/server/lib/ontopia-realm.jar

Original comment by indiapaleale@gmail.com on 7 Jul 2009 at 9:23

@GoogleCodeExporter
Copy link
Author

Does this problem persist in Ontopia 5.0.0?

Original comment by lar...@gmail.com on 8 Jul 2009 at 8:13

@GoogleCodeExporter
Copy link
Author

Just tried it myself, and, yes, the problem persists.

The same error message appears in the logs: 
javax.security.auth.login.LoginException: unable to find LoginModule 
class: net.ontopia.topicmaps.nav2.realm.TMLoginModule
        at javax.security.auth.login.LoginContext.invoke
(LoginContext.java:808)

server/lib does contain the ontopia-realm.jar, and that does contain the 
net.ontopia.topicmaps.nav2.realm.TMLoginModule class.

Not sure how to approach this, but it clearly is a bug, and the old fix clearly 
no 
longer works.

Original comment by lar...@gmail.com on 27 Jul 2009 at 11:22

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

A user reports the following showing up in the logs on startup:

ERROR 2009-08-13 07:09:48,462 realm.JAASRealm - Class
net.ontopia.topicmaps.nav2.realm.UserPrincipal not found! Class not
added.
ERROR 2009-08-13 07:09:48,463 realm.JAASRealm - Class
net.ontopia.topicmaps.nav2.realm.RolePrincipal not found! Class not
added.

This might be the real cause of the problem. Need to investigate further.

Original comment by lar...@gmail.com on 17 Aug 2009 at 8:53

@GoogleCodeExporter
Copy link
Author

Investigated these classes, but they are in the .jar and everything seems fine.

Tried googling possible causes, but came up empty-handed.

It may be that we have to post to one of the Tomcat mailing lists to see if we 
can 
get some help.

Original comment by lar...@gmail.com on 18 Aug 2009 at 2:32

@GoogleCodeExporter
Copy link
Author

I ran into the same problem. An extra clue might be that I included a handmade 
jar into the server/lib directory 
that used to work in earlier versions (tried upto 3.4.4), but fails in 5.0.0. 
It could be that JAASRealm no longer 
searches the server/lib directory when looking for classes. Seems like a Tomcat 
issue indeed. 

I confirm the message in comment 7 from a clean version 5.0.0 install. The 
message is generated while reading 
the conf/server.xml file.

Original comment by p.kruijsen on 2 Sep 2009 at 2:21

@GoogleCodeExporter
Copy link
Author

We've tracked this issue down to a difference in 
server/lib/catalina-optional.jar which contains 
org.apache.catalina.realm.JAASRealm. Google showed me that changes in that 
class seem to impact 
useContextClassLoader. Reverting to an earlier catalina-optional.jar solved 
this issue for us for now. We'll keep 
searching for a more elegant solution.

Original comment by p.kruijsen on 2 Sep 2009 at 3:31

@GoogleCodeExporter
Copy link
Author

Great to finally see some progress on this issue. Even if this isn't the ideal 
fix, 
at least it gives some indication of what's wrong.

I'm transferring the issue to you, since you're the only one working actively 
on it 
right now.

Great if you can solve this. If you can do so quickly enough we can get the fix 
into 
5.0.1. Otherwise it'll wait for 5.0.2.

Original comment by lar...@gmail.com on 2 Sep 2009 at 3:51

@GoogleCodeExporter
Copy link
Author

It is indeed the useContextClassLoader setting that causes this issue. 
Documentation is at the bottom of 
{ontopia}/webapps/tomcat-docs/config/realm.html. The 
default value 'true' turned out to cause a bug in Catalina, reported in 
https://issues.apache.org/bugzilla/show_bug.cgi?id=44084. Its fix in Tomcat 
5.5.26 caused 
our issue from OKS 4.0.3 onwards.

Resolution is to add the attribute useContextClassLoader="false" in every 
"Realm" element with className="org.apache.catalina.realm.JAASRealm" in 
conf/server.xml. I've added the attribute in 
ontopia/ontopia/src/dist/tomcat/server.xml for the accessctl webapp in revision 
459.

Original comment by p.kruijsen on 2 Sep 2009 at 5:00

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

Verified that the fix worked. Excellent work! :)

Original comment by lar...@gmail.com on 3 Sep 2009 at 9:19

  • Changed state: Verified
  • Added labels: Release5.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant