Reputation: 963
This is the problem:
I have a custom security domain that autentificates users in active directory but gets the roles from a file (in future from the DB)
Everything works like a charm per project, however the session is not shared across more than one project, even tho the projects share the same security domain, if the user autentificated in one project it has to autentificate again on the other.
Security Domain definition from standalone.xml
<security-domain name="custom-form-auth" cache-type="default">
<authentication>
<login-module code="ro.test.login.CustomLoginModule" flag="required" module="ro.test.Process-login">
<module-option name="activeDirectory" value="${jboss.server.config.dir}/activeDirectory.properties"/>
</login-module>
</authentication>
</security-domain>
jboss-web.xml
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
<security-domain>custom-form-auth</security-domain>
<disable-audit>true</disable-audit>
</jboss-web>
Upvotes: 1
Views: 537
Reputation: 5208
For shared authentication across applications you must enable the Single Signon functionality. The Single Signon configuration allows a centralized login configuration for corporate sites that use different Web context.
To enable SSO in JBoss7 you need add the sso
option in the web subsystem (SSO is configured per host):
<subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" native="false">
<connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
<virtual-server name="default-host" enable-welcome-root="true">
<alias name="localhost"/>
<alias name="example.com"/>
<sso reauthenticate="false"/>
</virtual-server>
</subsystem>
See: https://developer.jboss.org/wiki/JBossAS711WebSSONon-Clustered
Upvotes: 1