Fórumok

Problem Liferay5.2.3/Tomcat6.0 and JAAS

thumbnail
Frederik Weishäupl, módosítva 14 év-val korábban

Problem Liferay5.2.3/Tomcat6.0 and JAAS

Junior Member Bejegyzések: 46 Csatlakozás dátuma: 2006.01.08. Legújabb bejegyzések
Hi,

I've some problems with Liferay and JAAS.

I enabled JAAS with "portal.jaas.enable=true".
When I try to login I get the following exception:

08.02.2010 17:44:53 org.apache.catalina.realm.JAASRealm authenticate
SCHWERWIEGEND: Unexpected error
java.lang.SecurityException: Unable to locate a login configuration
at com.sun.security.auth.login.ConfigFile.<init>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at javax.security.auth.login.Configuration$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.Configuration.getConfiguration(Unknown Source)
at javax.security.auth.login.LoginContext$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.LoginContext.init(Unknown Source)
at javax.security.auth.login.LoginContext.<init>(Unknown Source)
at org.apache.catalina.realm.JAASRealm.authenticate(JAASRealm.java:345)
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:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: Unable to locate a login configuration
at com.sun.security.auth.login.ConfigFile.init(Unknown Source)
... 25 more


In my Tomcat ROOT.xml I have the following entry:

<Context path="" crossContext="true">
<!-- JAAS -->
<Realm className="org.apache.catalina.realm.JAASRealm" appName="PortalRealm" userClassNames="com.liferay.portal.kernel.security.jaas.PortalPrincipal" roleClassNames="com.liferay.portal.kernel.security.jaas.PortalRole" />
..
Any ideas how to solve this issue? Thanks a lot.
thumbnail
Lisa Simpson, módosítva 14 év-val korábban

RE: Problem Liferay5.2.3/Tomcat6.0 and JAAS

Liferay Legend Bejegyzések: 2034 Csatlakozás dátuma: 2009.03.05. Legújabb bejegyzések
What are you authenticating against?

java.lang.SecurityException: Unable to locate a login configuration
thumbnail
Frederik Weishäupl, módosítva 14 év-val korábban

RE: Problem Liferay5.2.3/Tomcat6.0 and JAAS

Junior Member Bejegyzések: 46 Csatlakozás dátuma: 2006.01.08. Legújabb bejegyzések
Hi,

I try to authenticate against com.liferay.portal.security.jaas.ext.tomcat.PortalLoginModule (Tomcat JAAS LoginModule in Liferay).

What I don't understand is the mechanism how Liferay knows which JAAS login module it has to call. I only set the parameter portal.jaas.enable=true in portal-ext.properties. I didn't set the parameter portal.jaas.impl.
Do I have to define a JAAS login configuration file (login.config) for a reference to to the specific login module?

Thanks for your help.
Mindaugas Plukas, módosítva 13 év-val korábban

RE: Problem Liferay5.2.3/Tomcat6.0 and JAAS

New Member Bejegyzés: 1 Csatlakozás dátuma: 2010.04.26. Legújabb bejegyzések
You should create JAAS login configuration file (see step 2) and 3)), which is missing as the error clearly indicates (java.lang.SecurityException: Unable to locate a login configuration).


1)Configure Tomcat JAAS realm

Edit /conf/Catalina/localhost/liferay.xml and configure a security realm. For Tomcat 5.5.x, edit /conf/Catalina/localhost/ROOT.xml.

<Context...>
<Realm
className="org.apache.catalina.realm.JAASRealm"
appName="PortalRealm"
userClassNames="com.liferay.portal.security.jaas.PortalPrincipal"
roleClassNames="com.liferay.portal.security.jaas.PortalRole"
debug="99"
useContextClassLoader="false"
/>
</Context>

2)Create /conf/jaas.config.

PortalRealm {
com.liferay.portal.security.jaas.PortalLoginModule required;
};


3)Edit /bin/catalina.bat so that Tomcat can reference the login module.

set JAVA_OPTS=%JAVA_OPTS%
-Djava.security.auth.login.config=%CATALINA_HOME%/conf/jaas.config

4)Set portal property
portal.jaas.enable=true


See, for example, http://www.catharijne.com/linux/73-tomcat--liferay or http://www.liferay.com/community/forums/-/message_boards/message/4256232
thumbnail
Vikas V, módosítva 12 év-val korábban

RE: Problem Liferay5.2.3/Tomcat6.0 and JAAS

Junior Member Bejegyzések: 83 Csatlakozás dátuma: 2011.09.28. Legújabb bejegyzések
Hi,

Can you please provide similar steps for Jboss AS 5.1.0 GA. Am using Liferay 6.

Regards,