How can I implement container managed authentication in Weblogic 12C using a jdbc data source?
<p>I had used container managed authentication with form based login-config element in web.xml and a jdbc data source for the users in tomcat, jboss and glassfish in the past but the configuration needed in weblogic is very complicated. I have managed to create an authentication provider that is linked to a data source by following this tutorial <a href="http://biemond.blogspot.gr/2008/12/using-database-tables-as-authentication.html" rel="nofollow">http://biemond.blogspot.gr/2008/12/using-database-tables-as-authentication.html</a> but when my user is logged in HttpServletRequest.isUserInRole returns false for the roles that I have defined in my web.xml obviously because I have not mapped the groups to which the user is mapped to any roles. I have a very simple database with a table USERS that has the column "email" which is the username and the column "password" which is the password. Also the table USERS_GROUPS contains a mapping between users and groups. It have two columns "email" and "groupname". I have also created an authenticator provider "Summary of Security Realms >myrealm >Providers >WEB_DEMO_SQLAuthenticator". I have set all the queries that it requires and my config.xml in my domain has this form:</p>

<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?xml version='1.0' encoding='UTF-8'?&gt;
&lt;domain xmlns="http://xmlns.oracle.com/weblogic/domain" xmlns:sec="http://xmlns.oracle.com/weblogic/security" xmlns:wls="http://xmlns.oracle.com/weblogic/security/wls" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/security/xacml http://xmlns.oracle.com/weblogic/security/xacml/1.0/xacml.xsd http://xmlns.oracle.com/weblogic/security/providers/passwordvalidator http://xmlns.oracle.com/weblogic/security/providers/passwordvalidator/1.0/passwordvalidator.xsd http://xmlns.oracle.com/weblogic/domain http://xmlns.oracle.com/weblogic/1.0/domain.xsd http://xmlns.oracle.com/weblogic/security http://xmlns.oracle.com/weblogic/1.0/security.xsd http://xmlns.oracle.com/weblogic/security/wls http://xmlns.oracle.com/weblogic/security/wls/1.0/wls.xsd"&gt;
  &lt;name&gt;demoWebApp&lt;/name&gt;
  &lt;domain-version&gt;12.1.3.0.0&lt;/domain-version&gt;
  &lt;security-configuration&gt;
    &lt;name&gt;demoWebApp&lt;/name&gt;
    &lt;realm&gt;
      &lt;sec:authentication-provider xsi:type="wls:default-authenticatorType"&gt;
        &lt;sec:name&gt;DefaultAuthenticator&lt;/sec:name&gt;
        &lt;sec:control-flag&gt;SUFFICIENT&lt;/sec:control-flag&gt;
      &lt;/sec:authentication-provider&gt;
      &lt;sec:authentication-provider xsi:type="wls:default-identity-asserterType"&gt;
        &lt;sec:name&gt;DefaultIdentityAsserter&lt;/sec:name&gt;
        &lt;sec:active-type&gt;AuthenticatedUser&lt;/sec:active-type&gt;
      &lt;/sec:authentication-provider&gt;
      &lt;sec:authentication-provider xsi:type="wls:sql-authenticatorType"&gt;
        &lt;sec:name&gt;WEB_DEMO_SQLAuthenticator&lt;/sec:name&gt;
        &lt;sec:control-flag&gt;SUFFICIENT&lt;/sec:control-flag&gt;
        &lt;wls:data-source-name&gt;WEB_DEMO&lt;/wls:data-source-name&gt;
        &lt;wls:plaintext-passwords-enabled&gt;true&lt;/wls:plaintext-passwords-enabled&gt;
        &lt;wls:descriptions-supported&gt;false&lt;/wls:descriptions-supported&gt;
        &lt;wls:sql-get-users-password&gt;SELECT PASSWORD FROM USERS WHERE EMAIL = ?&lt;/wls:sql-get-users-password&gt;
        &lt;wls:sql-user-exists&gt;SELECT EMAIL FROM USERS WHERE EMAIL = ?&lt;/wls:sql-user-exists&gt;
        &lt;wls:sql-list-member-groups&gt;SELECT EMAIL FROM USERS_GROUPS WHERE EMAIL = ?&lt;/wls:sql-list-member-groups&gt;
        &lt;wls:sql-list-users&gt;SELECT EMAIL FROM USERS WHERE EMAIL LIKE ?&lt;/wls:sql-list-users&gt;
        &lt;wls:sql-list-groups&gt;SELECT GROUPNAME FROM USERS_GROUPS WHERE GROUPNAME LIKE ?&lt;/wls:sql-list-groups&gt;
        &lt;wls:sql-group-exists&gt;SELECT GROUPNAME FROM USERS_GROUPS WHERE GROUPNAME = ?&lt;/wls:sql-group-exists&gt;
        &lt;wls:sql-is-member&gt;SELECT EMAIL FROM USERS_GROUPS WHERE GROUPNAME = ? AND EMAIL = ?&lt;/wls:sql-is-member&gt;
        &lt;wls:password-style&gt;PLAINTEXT&lt;/wls:password-style&gt;
        &lt;wls:sql-remove-user&gt;DELETE FROM USERS WHERE EMAIL = ?&lt;/wls:sql-remove-user&gt;
        &lt;wls:sql-remove-group-memberships&gt;DELETE FROM USERS_GROUPS WHERE EMAIL = ? OR GROUPNAME = ?&lt;/wls:sql-remove-group-memberships&gt;
        &lt;wls:sql-set-user-password&gt;UPDATE USERS SET PASWORD = ? WHERE EMAIL = ?&lt;/wls:sql-set-user-password&gt;
        &lt;wls:sql-create-group&gt;INSERT INTO USERS_GROUPS VALUES ( ? , ? )&lt;/wls:sql-create-group&gt;
        &lt;wls:sql-add-member-to-group&gt;INSERT INTO USERS_GROUPS VALUES( ?, ?)&lt;/wls:sql-add-member-to-group&gt;
        &lt;wls:sql-remove-member-from-group&gt;DELETE FROM USERS_GROUPS WHERE GROUPNAME = ? AND EMAIL = ?&lt;/wls:sql-remove-member-from-group&gt;
        &lt;wls:sql-remove-group&gt;DELETE FROM USERS_GROUPS WHERE GROUPNAME = ?&lt;/wls:sql-remove-group&gt;
        &lt;wls:sql-remove-group-member&gt;DELETE FROM USERS_GROUPS WHERE GROUPNAME = ?&lt;/wls:sql-remove-group-member&gt;
        &lt;wls:sql-list-group-members&gt;SELECT EMAIL FROM USERS_GROUPS WHERE GROUPNAME = ? AND EMAIL LIKE ?&lt;/wls:sql-list-group-members&gt;
      &lt;/sec:authentication-provider&gt;
      &lt;sec:role-mapper xmlns:xac="http://xmlns.oracle.com/weblogic/security/xacml" xsi:type="xac:xacml-role-mapperType"&gt;
        &lt;sec:name&gt;XACMLRoleMapper&lt;/sec:name&gt;
      &lt;/sec:role-mapper&gt;
      &lt;sec:authorizer xmlns:xac="http://xmlns.oracle.com/weblogic/security/xacml" xsi:type="xac:xacml-authorizerType"&gt;
        &lt;sec:name&gt;XACMLAuthorizer&lt;/sec:name&gt;
      &lt;/sec:authorizer&gt;
      &lt;sec:adjudicator xsi:type="wls:default-adjudicatorType"&gt;
        &lt;sec:name&gt;DefaultAdjudicator&lt;/sec:name&gt;
      &lt;/sec:adjudicator&gt;
      &lt;sec:credential-mapper xsi:type="wls:default-credential-mapperType"&gt;
        &lt;sec:name&gt;DefaultCredentialMapper&lt;/sec:name&gt;
      &lt;/sec:credential-mapper&gt;
      &lt;sec:cert-path-provider xsi:type="wls:web-logic-cert-path-providerType"&gt;
        &lt;sec:name&gt;WebLogicCertPathProvider&lt;/sec:name&gt;
      &lt;/sec:cert-path-provider&gt;
      &lt;sec:cert-path-builder&gt;WebLogicCertPathProvider&lt;/sec:cert-path-builder&gt;
      &lt;sec:name&gt;myrealm&lt;/sec:name&gt;
      &lt;sec:password-validator xmlns:pas="http://xmlns.oracle.com/weblogic/security/providers/passwordvalidator" xsi:type="pas:system-password-validatorType"&gt;
        &lt;sec:name&gt;SystemPasswordValidator&lt;/sec:name&gt;
        &lt;pas:min-password-length&gt;8&lt;/pas:min-password-length&gt;
        &lt;pas:min-numeric-or-special-characters&gt;1&lt;/pas:min-numeric-or-special-characters&gt;
      &lt;/sec:password-validator&gt;
    &lt;/realm&gt;
    &lt;default-realm&gt;myrealm&lt;/default-realm&gt;
    &lt;credential-encrypted&gt;{AES}HT7HPcfOUpYRXY6xa6XuJkpi9HxOSG83CxvdVS9swJI2kHYubpy204U5NvKB9qfP78k8NID6f3MU6YOE8dmCG3XypBM2hs3TFBDVNY+qA/SpNC6Sh89ly0eM0trBaylW&lt;/credential-encrypted&gt;
    &lt;node-manager-username&gt;weblogic&lt;/node-manager-username&gt;
    &lt;node-manager-password-encrypted&gt;{AES}O0ZR1sqaUUhJ2dJw6vGSuipZ7/65q3AFcGqf8uenlUs=&lt;/node-manager-password-encrypted&gt;
  &lt;/security-configuration&gt;
  &lt;server&gt;
    &lt;name&gt;AdminServer&lt;/name&gt;
    &lt;ssl&gt;
      &lt;name&gt;AdminServer&lt;/name&gt;
      &lt;enabled&gt;true&lt;/enabled&gt;
    &lt;/ssl&gt;
    &lt;listen-address&gt;&lt;/listen-address&gt;
    &lt;web-service&gt;
      &lt;name&gt;AdminServer&lt;/name&gt;
      &lt;web-service-persistence&gt;
        &lt;name&gt;AdminServer&lt;/name&gt;
        &lt;web-service-logical-store&gt;
          &lt;name&gt;WseeStore&lt;/name&gt;
          &lt;persistence-strategy&gt;LOCAL_ACCESS_ONLY&lt;/persistence-strategy&gt;
          &lt;request-buffering-queue-jndi-name&gt;weblogic.wsee.BufferedRequestQueue&lt;/request-buffering-queue-jndi-name&gt;
          &lt;response-buffering-queue-jndi-name&gt;weblogic.wsee.BufferedResponseQueue&lt;/response-buffering-queue-jndi-name&gt;
        &lt;/web-service-logical-store&gt;
      &lt;/web-service-persistence&gt;
    &lt;/web-service&gt;
    &lt;coherence-cluster-system-resource&gt;defaultCoherenceCluster&lt;/coherence-cluster-system-resource&gt;
  &lt;/server&gt;
  &lt;production-mode-enabled&gt;true&lt;/production-mode-enabled&gt;
  &lt;embedded-ldap&gt;
    &lt;name&gt;demoWebApp&lt;/name&gt;
    &lt;credential-encrypted&gt;{AES}ZJssc/1PU9tdjuviahUTvExJtL9ksS4c+7zKUC1IEJfl13jH/gns/tIil0D2g+rN&lt;/credential-encrypted&gt;
  &lt;/embedded-ldap&gt;
  &lt;configuration-version&gt;12.1.3.0.0&lt;/configuration-version&gt;
  &lt;app-deployment&gt;
    &lt;name&gt;state-management-provider-memory-rar-12.1.3&lt;/name&gt;
    &lt;target&gt;AdminServer&lt;/target&gt;
    &lt;module-type&gt;rar&lt;/module-type&gt;
    &lt;source-path&gt;C:/Oracle/Middleware/Oracle_Home/oracle_common/modules/com.oracle.state-management.state-management-provider-memory-rar-impl_12.1.3.rar&lt;/source-path&gt;
    &lt;security-dd-model&gt;DDOnly&lt;/security-dd-model&gt;
    &lt;staging-mode&gt;nostage&lt;/staging-mode&gt;
  &lt;/app-deployment&gt;
  &lt;app-deployment&gt;
    &lt;name&gt;_auto_generated_ear_&lt;/name&gt;
    &lt;target&gt;AdminServer&lt;/target&gt;
    &lt;module-type&gt;ear&lt;/module-type&gt;
    &lt;source-path&gt;C:\dev\eclipse_workspaces\WebAppDemo\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\demoWebApp\_auto_generated_ear_&lt;/source-path&gt;
    &lt;security-dd-model&gt;DDOnly&lt;/security-dd-model&gt;
    &lt;staging-mode xsi:nil="true"&gt;&lt;/staging-mode&gt;
    &lt;plan-staging-mode xsi:nil="true"&gt;&lt;/plan-staging-mode&gt;
    &lt;cache-in-app-directory&gt;false&lt;/cache-in-app-directory&gt;
  &lt;/app-deployment&gt;
  &lt;jms-server&gt;
    &lt;name&gt;WseeJaxwsJmsServer&lt;/name&gt;
    &lt;target&gt;AdminServer&lt;/target&gt;
    &lt;persistent-store&gt;WseeJaxwsFileStore&lt;/persistent-store&gt;
  &lt;/jms-server&gt;
  &lt;jms-server&gt;
    &lt;name&gt;WseeJmsServer&lt;/name&gt;
    &lt;target&gt;AdminServer&lt;/target&gt;
    &lt;persistent-store&gt;WseeFileStore&lt;/persistent-store&gt;
  &lt;/jms-server&gt;
  &lt;jms-server&gt;
    &lt;name&gt;WseeSoapjmsJmsServer&lt;/name&gt;
    &lt;target&gt;AdminServer&lt;/target&gt;
    &lt;persistent-store&gt;WseeSoapjmsFileStore&lt;/persistent-store&gt;
  &lt;/jms-server&gt;
  &lt;self-tuning&gt;
    &lt;work-manager&gt;
      &lt;name&gt;weblogic.wsee.jaxws.mdb.DispatchPolicy&lt;/name&gt;
      &lt;target&gt;AdminServer&lt;/target&gt;
    &lt;/work-manager&gt;
    &lt;work-manager&gt;
      &lt;name&gt;weblogic.wsee.mdb.DispatchPolicy&lt;/name&gt;
      &lt;target&gt;AdminServer&lt;/target&gt;
    &lt;/work-manager&gt;
  &lt;/self-tuning&gt;
  &lt;file-store&gt;
    &lt;name&gt;WseeJaxwsFileStore&lt;/name&gt;
    &lt;directory&gt;WseeJaxwsFileStore&lt;/directory&gt;
    &lt;target&gt;AdminServer&lt;/target&gt;
  &lt;/file-store&gt;
  &lt;file-store&gt;
    &lt;name&gt;WseeFileStore&lt;/name&gt;
    &lt;directory&gt;WseeFileStore&lt;/directory&gt;
    &lt;target&gt;AdminServer&lt;/target&gt;
  &lt;/file-store&gt;
  &lt;file-store&gt;
    &lt;name&gt;WseeSoapjmsFileStore&lt;/name&gt;
    &lt;directory&gt;WseeSoapjmsFileStore&lt;/directory&gt;
    &lt;target&gt;AdminServer&lt;/target&gt;
  &lt;/file-store&gt;
  &lt;jms-system-resource&gt;
    &lt;name&gt;WseeJaxwsJmsModule&lt;/name&gt;
    &lt;target&gt;AdminServer&lt;/target&gt;
    &lt;sub-deployment&gt;
      &lt;name&gt;WseeJaxwsJmsServerSub&lt;/name&gt;
      &lt;target&gt;WseeJaxwsJmsServer&lt;/target&gt;
    &lt;/sub-deployment&gt;
    &lt;descriptor-file-name&gt;jms/wseejaxwsjmsmodule-jms.xml&lt;/descriptor-file-name&gt;
  &lt;/jms-system-resource&gt;
  &lt;jms-system-resource&gt;
    &lt;name&gt;WseeJmsModule&lt;/name&gt;
    &lt;target&gt;AdminServer&lt;/target&gt;
    &lt;sub-deployment&gt;
      &lt;name&gt;BEA_JMS_MODULE_SUBDEPLOYMENT_WSEEJMSServer&lt;/name&gt;
      &lt;target&gt;WseeJmsServer&lt;/target&gt;
    &lt;/sub-deployment&gt;
    &lt;descriptor-file-name&gt;jms/wseejmsmodule-jms.xml&lt;/descriptor-file-name&gt;
  &lt;/jms-system-resource&gt;
  &lt;jms-system-resource&gt;
    &lt;name&gt;WseeSoapjmsJmsModule&lt;/name&gt;
    &lt;target&gt;AdminServer&lt;/target&gt;
    &lt;sub-deployment&gt;
      &lt;name&gt;WseeSoapjmsJmsServerSub&lt;/name&gt;
      &lt;target&gt;WseeSoapjmsJmsServer&lt;/target&gt;
    &lt;/sub-deployment&gt;
    &lt;descriptor-file-name&gt;jms/wseesoapjmsmodule-jms.xml&lt;/descriptor-file-name&gt;
  &lt;/jms-system-resource&gt;
  &lt;admin-server-name&gt;AdminServer&lt;/admin-server-name&gt;
  &lt;jdbc-system-resource&gt;
    &lt;name&gt;WEB_DEMO&lt;/name&gt;
    &lt;target&gt;AdminServer&lt;/target&gt;
    &lt;descriptor-file-name&gt;jdbc/WEB_DEMO-1358-jdbc.xml&lt;/descriptor-file-name&gt;
  &lt;/jdbc-system-resource&gt;
  &lt;saf-agent&gt;
    &lt;name&gt;ReliableWseeJaxwsSAFAgent&lt;/name&gt;
    &lt;target&gt;AdminServer&lt;/target&gt;
    &lt;store&gt;WseeJaxwsFileStore&lt;/store&gt;
  &lt;/saf-agent&gt;
  &lt;saf-agent&gt;
    &lt;name&gt;ReliableWseeSAFAgent&lt;/name&gt;
    &lt;target&gt;AdminServer&lt;/target&gt;
    &lt;store&gt;WseeFileStore&lt;/store&gt;
  &lt;/saf-agent&gt;
  &lt;coherence-cluster-system-resource&gt;
    &lt;name&gt;defaultCoherenceCluster&lt;/name&gt;
    &lt;descriptor-file-name&gt;coherence/defaultCoherenceCluster-coherence.xml&lt;/descriptor-file-name&gt;
  &lt;/coherence-cluster-system-resource&gt;
&lt;/domain&gt;</code></pre>
</div>
</div>
</p>

<p>I can see the users that I create in the weblogic console and their associated groups under Summary of Security Realms myrealm >Users and Groups,  but I don't know basically how to associate groups with roles. Can anyone help me with that? Thanks! I would prefer that my role to group association would be defined either in the database or in the weblogic.xml ...</p>