<?xml version="1.0" encoding="utf-8"?>
<creole>
    <variables>
        <family name='eole sso'>
            <variable name='activer_openid' type='oui/non' description="Autoriser l'authentification OpenID Connect" mode="expert">
                <value>non</value>
            </variable>
            <variable name='openid_providers' type='string' description="Référence du fournisseur d'identité OpenID" mode="expert" multi='True' mandatory='True'/>
            <variable name='openid_providers_label' type='string' description="Libellé du fournisseur d'identité OpenID" mandatory='True'/>
            <variable name='openid_providers_issuer' type='web_address' description="URL d'accès (issuer)" mandatory='True'/>
            <variable name='openid_providers_about_url' type='web_address' description="URL d'information (A propos)"/>
            <variable name='openid_providers_about_label' type='string' description="Libellé de l'URL d'information (A propos)"/>
            <variable name='openid_providers_auth_endp' type='web_address' description="URL de demande d'autorisation (authorization endpoint)" mandatory='True'/>
            <variable name='openid_providers_reg_endp' type='web_address' description="URL d'enregistrement automatique (register endpoint)" hidden='True'/>
            <variable name='openid_providers_token_endp' type='web_address' description="URL de récupération de jeton d'accès (token endpoint)" mandatory='True'/>
            <variable name='openid_providers_logout_endp' type='web_address' description="URL de déconnexion (logout endpoint)"/>
            <variable name='openid_providers_userinfo_endp' type='web_address' description="URL de lecture des informations (userinfo endpoint)"/>
            <variable name='openid_providers_jwks_uri' type='web_address' description="URL de description des certificats de signature (jwks URI)"/>
        </family>
        <separators>
            <separator name='activer_openid'>Authentification OpenID</separator>
        </separators>
    </variables>
    <constraints>
        <condition name='disabled_if_in' source='activer_openid'>
            <param>non</param>
            <target type='variable'>openid_providers</target>
        </condition>
        <group master='openid_providers'>
          <slave>openid_providers_label</slave>
          <slave>openid_providers_issuer</slave>
          <slave>openid_providers_about_url</slave>
          <slave>openid_providers_about_label</slave>
          <slave>openid_providers_auth_endp</slave>
          <slave>openid_providers_reg_endp</slave>
          <slave>openid_providers_token_endp</slave>
          <slave>openid_providers_logout_endp</slave>
          <slave>openid_providers_userinfo_endp</slave>
          <slave>openid_providers_jwks_uri</slave>
        </group>
        <check name="valid_enum" target="openid_providers">
            <param>['fconnect']</param>
            <param name="checkval">False</param>
        </check>
        <fill name='calc_multi_condition' target='openid_providers_label'>
            <param>fconnect</param>
            <param type='eole' name='condition_1'>openid_providers</param>
            <param name='match'>France Connect</param>
            <param name='default_mismatch'>None</param>
        </fill>
        <fill name='calc_multi_condition' target='openid_providers_about_label'>
            <param>fconnect</param>
            <param type='eole' name='condition_1'>openid_providers</param>
            <param name='match'>Qu'est ce que FranceConnect ?</param>
            <param name='default_mismatch'>None</param>
        </fill>
        <fill name='calc_multi_condition' target='openid_providers_about_url'>
            <param>fconnect</param>
            <param type='eole' name='condition_1'>openid_providers</param>
            <param name='match'>https://fcp.integ01.dev-franceconnect.fr/a-propos</param>
            <param name='default_mismatch'>None</param>
        </fill>
        <fill name='calc_multi_condition' target='openid_providers_issuer'>
            <param>fconnect</param>
            <param type='eole' name='condition_1'>openid_providers</param>
            <param name='match'>https://fcp.integ01.dev-franceconnect.fr/api/v1/</param>
            <param name='default_mismatch'>None</param>
        </fill>
        <fill name='calc_multi_condition' target='openid_providers_auth_endp'>
            <param>fconnect</param>
            <param type='eole' name='condition_1'>openid_providers</param>
            <param name='match'>https://fcp.integ01.dev-franceconnect.fr/api/v1/authorize</param>
            <param name='default_mismatch'>None</param>
        </fill>
        <fill name='calc_multi_condition' target='openid_providers_reg_endp'>
            <param>fconnect</param>
            <param type='eole' name='condition_1'>openid_providers</param>
            <param name='match'>https://fcp.integ01.dev-franceconnect.fr/api/v1/register</param>
            <param name='default_mismatch'>None</param>
        </fill>
        <fill name='calc_multi_condition' target='openid_providers_token_endp'>
            <param>fconnect</param>
            <param type='eole' name='condition_1'>openid_providers</param>
            <param name='match'>https://fcp.integ01.dev-franceconnect.fr/api/v1/token</param>
            <param name='default_mismatch'>None</param>
        </fill>
        <fill name='calc_multi_condition' target='openid_providers_userinfo_endp'>
            <param>fconnect</param>
            <param type='eole' name='condition_1'>openid_providers</param>
            <param name='match'>https://fcp.integ01.dev-franceconnect.fr/api/v1/userinfo</param>
            <param name='default_mismatch'>None</param>
        </fill>
        <fill name='calc_multi_condition' target='openid_providers_logout_endp'>
            <param>fconnect</param>
            <param type='eole' name='condition_1'>openid_providers</param>
            <param name='match'>https://fcp.integ01.dev-franceconnect.fr/api/v1/logout</param>
            <param name='default_mismatch'>None</param>
        </fill>
    </constraints>
    <help>
        <variable name='openid_providers'>nom du fournisseur d'identité. Non affiché, utilisé dans le nom des images (logos)</variable>
        <variable name='openid_providers_label'>Libellé présenté aux utilisateurs pour décrire le fournisseur</variable>
        <variable name='openid_providers_issuer'>URL de base du fournisseur d'identité (généralement appelée issuer)</variable>
        <variable name='openid_providers_auth_endp'>URL de réception des requêtes d'authentification.</variable>
        <variable name='openid_providers_reg_endp'>URL d'enregistrement automatique du client (non géré)</variable>
        <variable name='openid_providers_token_endp'>URL de récupération de jeton d'accès (access token)</variable>
        <variable name='openid_providers_logout_endp'>URL de déconnexion du fournisseur d'identité (non utilisé pour Google,Facebook,Live)</variable>
        <variable name='openid_providers_userinfo_endp'>URL de récupération des informations sur l'utilisateur (non utilisé si renvoyées avec le jeton d'accès)</variable>
        <variable name='openid_providers_jwks_uri'>URL décrivant les certificats utilisés pour la signature des jetons (si disponible)</variable>
    </help>
</creole>
