<?xml version="1.0" encoding="UTF-8"?>
<!--
 This file is part of the Meeds project (https://meeds.io/).

 Copyright (C) 2020 - 2025 Meeds Association contact@meeds.io

 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
 License as published by the Free Software Foundation; either
 version 3 of the License, or (at your option) any later version.
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 Lesser General Public License for more details.

 You should have received a copy of the GNU Lesser General Public License
 along with this program; if not, write to the Free Software Foundation,
 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-->
<jboss-identity xmlns="urn:picketlink:idm:config:v1_0_0_ga"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:schemaLocation="urn:picketlink:idm:config:v1_0_0_ga identity-config.xsd">
  <realms>
    <realm>
      <id>idm_realm</id>
      <repository-id-ref>DefaultPortalRepository</repository-id-ref>
      <identity-type-mappings>
        <user-mapping>USER</user-mapping>
      </identity-type-mappings>
      <options>
        <option>
          <name>template</name>
          <value>true</value>
        </option>
        <option>
          <name>oldCredentialEncoder.class</name>
          <value>${exo.plidm.password.oldClass:org.picketlink.idm.impl.credential.DatabaseReadingSaltEncoder}</value>
        </option>
        <option>
          <name>credentialEncoder.class</name>
          <value>${exo.plidm.password.class:org.exoplatform.web.security.hash.Argon2IdPasswordEncoder}</value>
        </option>
        <option>
          <name>credentialEncoder.hashAlgorithm</name>
          <value>${exo.plidm.password.hash:SHA-256}</value>
        </option>
        <option>
          <name>credentialEncoder.secureRandomAlgorithm</name>
          <value>${exo.plidm.password.secureRandomAlgorithm:SHA1PRNG}</value>
        </option>
      </options>
    </realm>
  </realms>
  <repositories>
    <repository>
      <id>DefaultPortalRepository</id>
      <class>org.picketlink.idm.impl.repository.WrapperIdentityStoreRepository</class>
      <external-config/>
      <default-identity-store-id>HibernateStore</default-identity-store-id>
      <default-attribute-store-id>HibernateStore</default-attribute-store-id>
    </repository>
  </repositories>
  <stores>
    <attribute-stores/>
    <identity-stores>
      <identity-store>
        <id>HibernateStore</id>
        <class>org.gatein.portal.idm.impl.store.hibernate.ExoHibernateIdentityStoreImpl</class>
        <external-config/>
        <supported-relationship-types>
          <relationship-type>JBOSS_IDENTITY_MEMBERSHIP</relationship-type>
          <relationship-type>JBOSS_IDENTITY_ROLE</relationship-type>
        </supported-relationship-types>
        <supported-identity-object-types>
          <identity-object-type>
            <name>USER</name>
            <relationships/>
            <credentials>
              <credential-type>PASSWORD</credential-type>
            </credentials>
            <attributes/>
            <options/>
          </identity-object-type>
        </supported-identity-object-types>
        <options>
          <option>
            <name>hibernateSessionFactoryRegistryName</name>
            <value>hibernateSessionFactory</value>
          </option>
          <option>
            <name>populateRelationshipTypes</name>
            <value>true</value>
          </option>
          <option>
            <name>populateIdentityObjectTypes</name>
            <value>true</value>
          </option>
          <option>
            <name>allowNotDefinedIdentityObjectTypes</name>
            <value>true</value>
          </option>
          <option>
            <name>allowNotDefinedAttributes</name>
            <value>true</value>
          </option>
          <option>
            <name>allowNotCaseSensitiveSearch</name>
            <value>${exo.idm.search.notCaseSensitive:true}</value>
          </option>
          <option>
            <name>isRealmAware</name>
            <value>true</value>
          </option>
          <option>
            <name>lazyStartOfHibernateTransaction</name>
            <value>true</value>
          </option>
        </options>
      </identity-store>
    </identity-stores>
  </stores>
  <options>
    <option>
      <name>defaultTemplate</name>
      <value>idm_realm</value>
    </option>
  </options>
</jboss-identity>
