Setup many jdbcRealm on payara server

662 Views Asked by At

I m triyng to deploy many Java EE Web application on the same payara domain. Each application have security constraints, for that i'm using JAAS.

I'm triyng to setup many jdbcRealms for each application, each one of them related to a jdbc connection pool to retrive user credentials from databases.

The first application(first defined jdbcRealm) work well, but the second one geve me the following error :

GRAVE:   jdbcrealm.invaliduser AVERTISSEMENT:   
WEB9102: Web Login Failed: com.sun.enterprise.security.auth.login.common.LoginException:Login failed: Security Exception

I don't find any error on my jdbcRealm definition, i'v only worried if i can define more than a one jdbcRealm per domain.

Thank's.

2

There are 2 best solutions below

1
OndroMih On

This means that the user AVERTISSEMENT isn't found in the table that the second realm searches in. If you use different table of users for these 2 realms, you probably forgot to create on of the tables in the database or forgot to create the user in it.

0
mohamed abdelbassat Salhi On

After many attempts I was able to create my jdbc realm for my deployed application on payara 5.182. enter image description here The tricks to make it work, is, to not set the encryption algorithm or the encoding. Only the Jdbc resource name, the table for accounts and groups are enough. enter image description here

I have tested the procedure many times on different OS and JVMs and it works.