From fe44396aa655547e32b37b7c51400f5fb47dc86a Mon Sep 17 00:00:00 2001 From: VANNEAU Date: Fri, 10 Dec 2021 16:09:10 +0100 Subject: [PATCH] Init --- docker-compose.yml | 119 ++ nginx/hosts | 7 + nginx/nginx.conf | 55 + nginx/ssl/www.epa.apside.com.crt | 21 + nginx/ssl/www.epa.apside.com.key | 28 + realm-export.json | 2165 ++++++++++++++++++++++++++++++ scripts/restart.sh | 3 + scripts/restart.txt | 4 + sql/init-sql.sql | 286 ++++ 9 files changed, 2688 insertions(+) create mode 100644 docker-compose.yml create mode 100644 nginx/hosts create mode 100644 nginx/nginx.conf create mode 100644 nginx/ssl/www.epa.apside.com.crt create mode 100644 nginx/ssl/www.epa.apside.com.key create mode 100644 realm-export.json create mode 100644 scripts/restart.sh create mode 100644 scripts/restart.txt create mode 100644 sql/init-sql.sql diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..fe96522 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,119 @@ +version: "3.8" + +networks: + epa-networks: + +services: + + digitepa_proxy: + hostname: digitepa_proxy + container_name: "digitepa_proxy" + image: nginx:1.21.3 + volumes: + - ./nginx/nginx.conf:/etc/nginx/nginx.conf + - ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf + - ./nginx/hosts:/etc/hosts + #- ./nginx/ssl/www.epa.apside.com.crt:/etc/nginx/ssl/www.epa.apside.com.crt + #- ./nginx/ssl/www.epa.apside.com.key:/etc/nginx/ssl/www.epa.apside.com.key + ports: + - "80:80" + - "443:443" + links: + - digitepa_front + - digitepa_back + networks: + - epa-networks + + keycloak: + hostname: digitepa_keycloak + container_name: "digitepa_keycloak" + image: jboss/keycloak:15.0.2 + environment: + - KEYCLOAK_USER=${LOGIN_KEYCLOAK:-admin} + - KEYCLOAK_PASSWORD=${PASS_KEYCLOAK:-admin} + - KEYCLOAK_IMPORT=/tmp/EPA-realm.json + - PROXY_ADDRESS_FORWARDING=true + volumes: + - ./realm-export.json:/tmp/EPA-realm.json + #expose: + # - "8080" + ports: + - "8080:8080" + networks: + - epa-networks + + digitepa_front: + hostname: digitepa_front + container_name: "digitepa_front" + build: + context: ${PATH_SRC_FRONT} + ports: + - "4200:4200" + networks: + - epa-networks + + + digitepa_back: + hostname: digitepa_back + container_name: "digitepa_back" + build: + context: ${PATH_SRC_BACK} + environment: + - ASPNETCORE_ENVIRONMENT=Development + - ASPNETCORE_URLS=https://+:44393;http://+:44394 + - ASPNETCORE_Kestrel__Certificates__Default__Password=Epa@digit852 + - ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx + expose: + - "44393" + - "44394" + ports: + - "44393:44393" + - "44394:44394" + networks: + - epa-networks + links: + - digitepa_db + volumes: + - ${PATH_SRC_BACK}/digitepa_cert.pfx:/https/aspnetapp.pfx + + + digitepa_collab: + hostname: digitepa_collab + container_name: "digitepa_collab" + build: + context: ${PATH_SRC_COLL} + environment: + - ASPNETCORE_ENVIRONMENT=Development + - ASPNETCORE_URLS=http://+:44318 + #- ASPNETCORE_Kestrel__Certificates__Default__Password=Epa@digit852 + #- ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx + expose: + - "44318" + ports: + - "44318:44318" + networks: + - epa-networks + + digitepa_db: + hostname: digitepa_db + container_name: "digitepa_db" + image: mysql:8.0.27 + environment: + MYSQL_USER: ${LOGIN_DB:-dev} + MYSQL_PASSWORD: ${PASS_DB:-dev} + MYSQL_ROOT_PASSWORD: ${PASS_DB_ROOT:-passwd} + MYSQL_DATABASE: ${DATABASE:-database_ep} + expose: + - "3306" + ports: + - "3306:3306" + networks: + - epa-networks + volumes: + - ep-db:/var/lib/mysql + - ./sql/init-sql.sql:/docker-entrypoint-initdb.d/init.sql + restart: always + + +volumes: + ep-db: \ No newline at end of file diff --git a/nginx/hosts b/nginx/hosts new file mode 100644 index 0000000..69ae6fd --- /dev/null +++ b/nginx/hosts @@ -0,0 +1,7 @@ +127.0.0.1 www.epa.apside.com +::1 localhost ip6-localhost ip6-loopback +fe00::0 ip6-localnet +ff00::0 ip6-mcastprefix +ff02::1 ip6-allnodes +ff02::2 ip6-allrouters +172.29.0.4 digitepa_proxy \ No newline at end of file diff --git a/nginx/nginx.conf b/nginx/nginx.conf new file mode 100644 index 0000000..ce5fd2d --- /dev/null +++ b/nginx/nginx.conf @@ -0,0 +1,55 @@ +worker_processes auto; + +events { worker_connections 1024; } + +http { + + upstream digitepa_front_up { + server digitepa_front:4200; + } + + upstream digitepa_back_up { + server digitepa_back:44393; + } + + #upstream digitepa_keycloak_up { + # server digitepa_keycloak:8080; + #} + + #server { + # listen 80 default_server; + # server_name www.epa.apside.com; + + #location / { + # return 301 https://$host$request_uri; + #} + + #} + + server { + #listen 443 ssl; + listen 80; + server_name www.epa.apside.com; + + index index.html index.htm; + + #ssl_certificate /etc/nginx/ssl/www.epa.apside.com.crt; + #ssl_certificate_key /etc/nginx/ssl/www.epa.apside.com.key; + + + location / { + proxy_pass http://digitepa_front_up/; + } + + location /api { + proxy_pass https://digitepa_back_up/api; + } + + location /auth { + proxy_pass http://digitepa_keycloak:8080/auth; + } + + } + + +} \ No newline at end of file diff --git a/nginx/ssl/www.epa.apside.com.crt b/nginx/ssl/www.epa.apside.com.crt new file mode 100644 index 0000000..8fd3931 --- /dev/null +++ b/nginx/ssl/www.epa.apside.com.crt @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDYzCCAkugAwIBAgIUa7TK6w3fGjR66Yy3SHEYHnwiPR4wDQYJKoZIhvcNAQEL +BQAwQTELMAkGA1UEBhMCRlIxDzANBgNVBAgMBkZyYW5jZTEQMA4GA1UEBwwHT3Js +ZWFuczEPMA0GA1UECgwGQXBzaWRlMB4XDTIxMTExNzExMjI0NloXDTIyMTExNzEx +MjI0NlowQTELMAkGA1UEBhMCRlIxDzANBgNVBAgMBkZyYW5jZTEQMA4GA1UEBwwH +T3JsZWFuczEPMA0GA1UECgwGQXBzaWRlMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEAt3kqsTKUAo8wdEIMnsV2QwlTc69OryxD23g56l8k/aVi76FXbxzk +V6gVCgfOQb0JXWH8OGi4gfWdzFy6XJ2JMPxvKvcXvECvZbQj5owt335ifTSw+aX9 +pkSiulOOzl3F/MSghfUc5TEdlwB3S6zofYcDEVOgE/yu7Ruc07rOwa3s7laBs8Ek +N+bp/+rki55DdZF4DGGQNdN6DlTYSgudJ3X3PSpVMaY08lI+DHGd5Wt/cv9eYWrk +p5qW4KXfaUK9XA+Gm7vMM52vBv9Illdw7/xXLrQcwuBUBD86E5Pwr60Ve/5pRVGd +3hgKvbd+ioFTjVHbaVvLd0KY8XrOEyGmxQIDAQABo1MwUTAdBgNVHQ4EFgQUjqlT +IlV9f7stl4GjXMykWp7lSqIwHwYDVR0jBBgwFoAUjqlTIlV9f7stl4GjXMykWp7l +SqIwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAnof3oRTKNRzU +dbAY2iEFh0xAQRcoraYAHOXe8h76cxFnMSmdscKl50h6JFAssfBjjjdKrdy0KjHd +0FQuqPHkVcYIE2w1H/+jYjGAzpkAW90f0rNOTsbO/+lyc6n5XJx2I/XMsfBoCBDn +g3IUhDvz1DkW3iRbh59JH98c85F3XH5+9fueXyYYIbykhMDkGw6X7N5wDUw4g0MD +qCedATlr3cIqfB2jAYW9PlDmwK4jmPsWiOJQruxJBSsM+eVJ56XgenzvuSaQkCd9 +mzArDtr9yCqiIxOir2L7cHXASu2qAs6m3MHh5CswoS0DheRU1EleZRscE35mCSip ++EYyZUk8Zw== +-----END CERTIFICATE----- diff --git a/nginx/ssl/www.epa.apside.com.key b/nginx/ssl/www.epa.apside.com.key new file mode 100644 index 0000000..51f221f --- /dev/null +++ b/nginx/ssl/www.epa.apside.com.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC3eSqxMpQCjzB0 +QgyexXZDCVNzr06vLEPbeDnqXyT9pWLvoVdvHORXqBUKB85BvQldYfw4aLiB9Z3M +XLpcnYkw/G8q9xe8QK9ltCPmjC3ffmJ9NLD5pf2mRKK6U47OXcX8xKCF9RzlMR2X +AHdLrOh9hwMRU6AT/K7tG5zTus7BrezuVoGzwSQ35un/6uSLnkN1kXgMYZA103oO +VNhKC50ndfc9KlUxpjTyUj4McZ3la39y/15hauSnmpbgpd9pQr1cD4abu8wzna8G +/0iWV3Dv/FcutBzC4FQEPzoTk/CvrRV7/mlFUZ3eGAq9t36KgVONUdtpW8t3Qpjx +es4TIabFAgMBAAECggEBAKjiid/OdNvePnXljoRfszqFzSGBz2YD0vqksnsA1aX9 +pRJ7a2ZGLBJcD/HJuZxdi88/sNGj46MNGhHRkWJLSMukshfUly6cRFfT9+/yPQ+q +4LHr3LQQjWmNaFUnMR7YxrSjsjdcpxp5mYkzzpwEL4XMz5AVcBa107dCYZusK0Gv +bpeIDZay5ZqHbIxm5qDRwbQqp7dh+RO9YioSEbQiRspiUqoeOaQOUisKqmP9GO0e +x1AN84uN8WDJytvtPJ62kgCAR4t4nBY3YLjG/46++djjUOsclVFmXuahYvfU11oY +FdMRbOlp40v1NCdwmFa7Dw2bNfe88MWxN5tgcx1X7kECgYEA2irOyDe4R2BSA0a/ +quP3I9p2Vh5AX/TAkViF17RCyP8NK6Xih9ITUjg38sMqKsWydBZrB/EgHkIZrLdW +DeyFXMcf/e/bkDr0VaPxcXDx/AoybSvh6CqnJ3toPII6L9OP4dMsXJ74lKqkbJGV +P2w9Km0qQCfZa0cZCqlSBpteeOkCgYEA10otWzsSRhGwdGa1mLIqtzAdVMs/nPw0 +5GsAUo3Fy31WE5YN9n4i69p6WKr17z+i0rBeT0k4FzVtT4ra4QtnpRPcYMYm1TRf +EtLSzUj2x+CzL6fDi9OKtZt8KXeM3eqE7tTqL+kfMUlqGD/07P2CFZXP2bWVytX6 +KFs4qkf5lX0CgYEAt/j7UOlz03TNFAg4HsKIKMrTmYF/Jau+K5Lrot9Wpio2EAWe +BozHUEEqJOQhDdqSxsQU06ipPfrdrcEYpzs5pugf+UKn83NTkVhjhRcKaFCs/1TO +9rnpJSky2Du1F5mfLn6mXSCNXMidSRRnOAltdvaBd4JjHMziuBPaoMmqG+kCgYBv +OiiSwMMhJlR23vWlTS9ac2ZD/7n+3iJpfIqvHAX7quaEufq+xc4+8iJRmwnysHrr +xSkEZ3yuKPEvrjqFGEJU/BzYdqdrcWJJNFiqrK6q94E79r3FiOZaC1mrhtNld5t0 +VNYlKJjv+tDwdGKS6iqCAmNfRDx+jexvWym8d/EPdQKBgQCRY9HXQOGcVhUMuh/8 +KH1VHjiV6DBnEDPlbTQP6k6c8wfpSFlHy2Yh87a2lQicyN1nO4cR8Rtsc6h4xoFP +49PHbvi2SoqOdsFoBtb/e1rR5zYXA01jHeB82Ebludou8wv0EcLIVIaVue7M1+wu +AFQ2r0jRhiYycr/sFwCvSCxVwA== +-----END PRIVATE KEY----- diff --git a/realm-export.json b/realm-export.json new file mode 100644 index 0000000..126a91d --- /dev/null +++ b/realm-export.json @@ -0,0 +1,2165 @@ +{ + "id": "Apside", + "realm": "Apside", + "notBefore": 1614087253, + "revokeRefreshToken": false, + "refreshTokenMaxReuse": 0, + "accessTokenLifespan": 300, + "accessTokenLifespanForImplicitFlow": 900, + "ssoSessionIdleTimeout": 1800, + "ssoSessionMaxLifespan": 36000, + "ssoSessionIdleTimeoutRememberMe": 0, + "ssoSessionMaxLifespanRememberMe": 0, + "offlineSessionIdleTimeout": 2592000, + "offlineSessionMaxLifespanEnabled": false, + "offlineSessionMaxLifespan": 5184000, + "clientSessionIdleTimeout": 0, + "clientSessionMaxLifespan": 0, + "clientOfflineSessionIdleTimeout": 0, + "clientOfflineSessionMaxLifespan": 0, + "accessCodeLifespan": 60, + "accessCodeLifespanUserAction": 300, + "accessCodeLifespanLogin": 1800, + "actionTokenGeneratedByAdminLifespan": 43200, + "actionTokenGeneratedByUserLifespan": 300, + "enabled": true, + "sslRequired": "external", + "registrationAllowed": false, + "registrationEmailAsUsername": false, + "rememberMe": false, + "verifyEmail": false, + "loginWithEmailAllowed": true, + "duplicateEmailsAllowed": false, + "resetPasswordAllowed": false, + "editUsernameAllowed": false, + "bruteForceProtected": false, + "permanentLockout": false, + "maxFailureWaitSeconds": 900, + "minimumQuickLoginWaitSeconds": 60, + "waitIncrementSeconds": 60, + "quickLoginCheckMilliSeconds": 1000, + "maxDeltaTimeSeconds": 43200, + "failureFactor": 30, + "roles": { + "realm": [ + { + "id": "927e55aa-9f85-42bc-97d9-620c87dad73d", + "name": "offline_access", + "description": "${role_offline-access}", + "composite": false, + "clientRole": false, + "containerId": "Apside", + "attributes": {} + }, + { + "id": "a2da09f3-ff6a-469f-8e4c-e89f3f447aa7", + "name": "uma_authorization", + "description": "${role_uma_authorization}", + "composite": false, + "clientRole": false, + "containerId": "Apside", + "attributes": {} + } + ], + "client": { + "realm-management": [ + { + "id": "0370f25f-7b91-4fa5-b25a-baba655b123c", + "name": "impersonation", + "description": "${role_impersonation}", + "composite": false, + "clientRole": true, + "containerId": "c8b1d33c-921e-43ad-be8d-65a73556b67c", + "attributes": {} + }, + { + "id": "fed75558-c818-4721-8944-020a8831466b", + "name": "realm-admin", + "description": "${role_realm-admin}", + "composite": true, + "composites": { + "client": { + "realm-management": [ + "impersonation", + "manage-events", + "query-users", + "view-authorization", + "manage-authorization", + "query-realms", + "manage-realm", + "manage-clients", + "view-clients", + "query-clients", + "view-identity-providers", + "view-realm", + "manage-identity-providers", + "view-events", + "query-groups", + "manage-users", + "view-users", + "create-client" + ] + } + }, + "clientRole": true, + "containerId": "c8b1d33c-921e-43ad-be8d-65a73556b67c", + "attributes": {} + }, + { + "id": "7b435c65-1514-4f37-9a4e-b9a6a126ece0", + "name": "manage-events", + "description": "${role_manage-events}", + "composite": false, + "clientRole": true, + "containerId": "c8b1d33c-921e-43ad-be8d-65a73556b67c", + "attributes": {} + }, + { + "id": "c26f05e3-ce99-49f0-8ec3-d5cbcc9b6949", + "name": "query-users", + "description": "${role_query-users}", + "composite": false, + "clientRole": true, + "containerId": "c8b1d33c-921e-43ad-be8d-65a73556b67c", + "attributes": {} + }, + { + "id": "264508f2-d50f-4324-a0de-b24df99a71ed", + "name": "view-authorization", + "description": "${role_view-authorization}", + "composite": false, + "clientRole": true, + "containerId": "c8b1d33c-921e-43ad-be8d-65a73556b67c", + "attributes": {} + }, + { + "id": "5856b01a-508d-493d-ba01-3ede3ebff385", + "name": "manage-authorization", + "description": "${role_manage-authorization}", + "composite": false, + "clientRole": true, + "containerId": "c8b1d33c-921e-43ad-be8d-65a73556b67c", + "attributes": {} + }, + { + "id": "f098e70a-48fe-46ca-87d5-6a093fea820b", + "name": "query-realms", + "description": "${role_query-realms}", + "composite": false, + "clientRole": true, + "containerId": "c8b1d33c-921e-43ad-be8d-65a73556b67c", + "attributes": {} + }, + { + "id": "fd070f80-0ceb-4147-b528-d54c8da21eba", + "name": "manage-realm", + "description": "${role_manage-realm}", + "composite": false, + "clientRole": true, + "containerId": "c8b1d33c-921e-43ad-be8d-65a73556b67c", + "attributes": {} + }, + { + "id": "bf73450d-dfbf-484a-ad0d-30ca96cf5d6a", + "name": "manage-clients", + "description": "${role_manage-clients}", + "composite": false, + "clientRole": true, + "containerId": "c8b1d33c-921e-43ad-be8d-65a73556b67c", + "attributes": {} + }, + { + "id": "d1addc1c-6924-4463-99e8-2ae2f4313313", + "name": "query-clients", + "description": "${role_query-clients}", + "composite": false, + "clientRole": true, + "containerId": "c8b1d33c-921e-43ad-be8d-65a73556b67c", + "attributes": {} + }, + { + "id": "7b93a44f-0855-4e77-9cb8-ec52064bbcd7", + "name": "view-clients", + "description": "${role_view-clients}", + "composite": true, + "composites": { + "client": { + "realm-management": [ + "query-clients" + ] + } + }, + "clientRole": true, + "containerId": "c8b1d33c-921e-43ad-be8d-65a73556b67c", + "attributes": {} + }, + { + "id": "52c269e1-4781-494d-b391-d9b2097b817b", + "name": "view-identity-providers", + "description": "${role_view-identity-providers}", + "composite": false, + "clientRole": true, + "containerId": "c8b1d33c-921e-43ad-be8d-65a73556b67c", + "attributes": {} + }, + { + "id": "707acd2f-f612-4e1f-8391-496aad73d8bb", + "name": "view-realm", + "description": "${role_view-realm}", + "composite": false, + "clientRole": true, + "containerId": "c8b1d33c-921e-43ad-be8d-65a73556b67c", + "attributes": {} + }, + { + "id": "b29e4e66-e516-41a0-a9d5-46033fabdf21", + "name": "manage-identity-providers", + "description": "${role_manage-identity-providers}", + "composite": false, + "clientRole": true, + "containerId": "c8b1d33c-921e-43ad-be8d-65a73556b67c", + "attributes": {} + }, + { + "id": "c89e021f-9dca-43fb-b842-4684a09a7e5d", + "name": "query-groups", + "description": "${role_query-groups}", + "composite": false, + "clientRole": true, + "containerId": "c8b1d33c-921e-43ad-be8d-65a73556b67c", + "attributes": {} + }, + { + "id": "913d15d7-0bb3-4d9e-b37b-91e21f7f24b9", + "name": "view-events", + "description": "${role_view-events}", + "composite": false, + "clientRole": true, + "containerId": "c8b1d33c-921e-43ad-be8d-65a73556b67c", + "attributes": {} + }, + { + "id": "62857a2f-6193-4445-b07f-1a2730451170", + "name": "manage-users", + "description": "${role_manage-users}", + "composite": false, + "clientRole": true, + "containerId": "c8b1d33c-921e-43ad-be8d-65a73556b67c", + "attributes": {} + }, + { + "id": "ff76388a-cf22-4ab9-a055-bc2368a9f320", + "name": "view-users", + "description": "${role_view-users}", + "composite": true, + "composites": { + "client": { + "realm-management": [ + "query-users", + "query-groups" + ] + } + }, + "clientRole": true, + "containerId": "c8b1d33c-921e-43ad-be8d-65a73556b67c", + "attributes": {} + }, + { + "id": "898a27c0-dd1d-4c90-aac9-8b2b51490443", + "name": "create-client", + "description": "${role_create-client}", + "composite": false, + "clientRole": true, + "containerId": "c8b1d33c-921e-43ad-be8d-65a73556b67c", + "attributes": {} + } + ], + "security-admin-console": [], + "GestionEPA": [ + { + "id": "7250e09f-6a22-44c1-aabb-ee237822be1d", + "name": "Manager", + "composite": true, + "composites": { + "client": { + "GestionEPA": [ + "Staff" + ] + } + }, + "clientRole": true, + "containerId": "e9ec3962-c63b-4b2c-a873-d53ea50e1e18", + "attributes": {} + }, + { + "id": "a19ec1c0-578c-431d-8848-45352c9a53ff", + "name": "RH", + "composite": true, + "composites": { + "client": { + "GestionEPA": [ + "Staff" + ] + } + }, + "clientRole": true, + "containerId": "e9ec3962-c63b-4b2c-a873-d53ea50e1e18", + "attributes": {} + }, + { + "id": "3df18e8c-a348-426d-a2c4-8eb352528046", + "name": "Assistante", + "composite": true, + "composites": { + "client": { + "GestionEPA": [ + "Staff" + ] + } + }, + "clientRole": true, + "containerId": "e9ec3962-c63b-4b2c-a873-d53ea50e1e18", + "attributes": {} + }, + { + "id": "4fba651b-ef1d-46ee-af88-b3d222291423", + "name": "Collaborateur", + "composite": false, + "clientRole": true, + "containerId": "e9ec3962-c63b-4b2c-a873-d53ea50e1e18", + "attributes": {} + }, + { + "id": "7084fe93-467e-4499-8965-5b20c787420c", + "name": "Staff", + "composite": false, + "clientRole": true, + "containerId": "e9ec3962-c63b-4b2c-a873-d53ea50e1e18", + "attributes": {} + }, + { + "id": "0e0c81b7-c013-4715-a41f-2a4022c57224", + "name": "RA", + "composite": true, + "composites": { + "client": { + "GestionEPA": [ + "Staff" + ] + } + }, + "clientRole": true, + "containerId": "e9ec3962-c63b-4b2c-a873-d53ea50e1e18", + "attributes": {} + } + ], + "admin-cli": [], + "account-console": [], + "broker": [ + { + "id": "a10ff5e4-003e-45b1-8733-e159c1722fa8", + "name": "read-token", + "description": "${role_read-token}", + "composite": false, + "clientRole": true, + "containerId": "f91cfb3d-aa60-42d6-b1ae-1f9b2d9243ce", + "attributes": {} + } + ], + "account": [ + { + "id": "01ccac8e-6d54-48f5-983a-6dda676fd4a4", + "name": "delete-account", + "description": "${role_delete-account}", + "composite": false, + "clientRole": true, + "containerId": "48732f8d-4a42-4e84-a948-36826c4ae908", + "attributes": {} + }, + { + "id": "b76c8ee5-2749-4e72-8213-558f7d1d0167", + "name": "manage-consent", + "description": "${role_manage-consent}", + "composite": true, + "composites": { + "client": { + "account": [ + "view-consent" + ] + } + }, + "clientRole": true, + "containerId": "48732f8d-4a42-4e84-a948-36826c4ae908", + "attributes": {} + }, + { + "id": "b5b3b515-2ffd-41af-957d-dfa822efb3b1", + "name": "manage-account-links", + "description": "${role_manage-account-links}", + "composite": false, + "clientRole": true, + "containerId": "48732f8d-4a42-4e84-a948-36826c4ae908", + "attributes": {} + }, + { + "id": "219cc0a9-c7c9-445f-89d5-3a7e976f942e", + "name": "view-consent", + "description": "${role_view-consent}", + "composite": false, + "clientRole": true, + "containerId": "48732f8d-4a42-4e84-a948-36826c4ae908", + "attributes": {} + }, + { + "id": "28551b11-1e55-4c65-9e25-07774c1b5d0e", + "name": "view-applications", + "description": "${role_view-applications}", + "composite": false, + "clientRole": true, + "containerId": "48732f8d-4a42-4e84-a948-36826c4ae908", + "attributes": {} + }, + { + "id": "571114e7-20e0-45ac-9cae-50c708913644", + "name": "manage-account", + "description": "${role_manage-account}", + "composite": true, + "composites": { + "client": { + "account": [ + "manage-account-links" + ] + } + }, + "clientRole": true, + "containerId": "48732f8d-4a42-4e84-a948-36826c4ae908", + "attributes": {} + }, + { + "id": "6cd80433-ba5c-4ec0-8775-d6b9cbbae1c3", + "name": "view-profile", + "description": "${role_view-profile}", + "composite": false, + "clientRole": true, + "containerId": "48732f8d-4a42-4e84-a948-36826c4ae908", + "attributes": {} + } + ] + } + }, + "groups": [], + "defaultRoles": [ + "offline_access", + "uma_authorization" + ], + "requiredCredentials": [ + "password" + ], + "otpPolicyType": "totp", + "otpPolicyAlgorithm": "HmacSHA1", + "otpPolicyInitialCounter": 0, + "otpPolicyDigits": 6, + "otpPolicyLookAheadWindow": 1, + "otpPolicyPeriod": 30, + "otpSupportedApplications": [ + "FreeOTP", + "Google Authenticator" + ], + "webAuthnPolicyRpEntityName": "keycloak", + "webAuthnPolicySignatureAlgorithms": [ + "ES256" + ], + "webAuthnPolicyRpId": "", + "webAuthnPolicyAttestationConveyancePreference": "not specified", + "webAuthnPolicyAuthenticatorAttachment": "not specified", + "webAuthnPolicyRequireResidentKey": "not specified", + "webAuthnPolicyUserVerificationRequirement": "not specified", + "webAuthnPolicyCreateTimeout": 0, + "webAuthnPolicyAvoidSameAuthenticatorRegister": false, + "webAuthnPolicyAcceptableAaguids": [], + "webAuthnPolicyPasswordlessRpEntityName": "keycloak", + "webAuthnPolicyPasswordlessSignatureAlgorithms": [ + "ES256" + ], + "webAuthnPolicyPasswordlessRpId": "", + "webAuthnPolicyPasswordlessAttestationConveyancePreference": "not specified", + "webAuthnPolicyPasswordlessAuthenticatorAttachment": "not specified", + "webAuthnPolicyPasswordlessRequireResidentKey": "not specified", + "webAuthnPolicyPasswordlessUserVerificationRequirement": "not specified", + "webAuthnPolicyPasswordlessCreateTimeout": 0, + "webAuthnPolicyPasswordlessAvoidSameAuthenticatorRegister": false, + "webAuthnPolicyPasswordlessAcceptableAaguids": [], + "scopeMappings": [ + { + "clientScope": "offline_access", + "roles": [ + "offline_access" + ] + } + ], + "clientScopeMappings": { + "account": [ + { + "client": "account-console", + "roles": [ + "manage-account" + ] + } + ] + }, + "clients": [ + { + "id": "e9ec3962-c63b-4b2c-a873-d53ea50e1e18", + "clientId": "GestionEPA", + "rootUrl": "http://localhost:4200", + "baseUrl": "", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "secret": "**********", + "redirectUris": [ + "http://localhost:4200" + ], + "webOrigins": [ + "*" + ], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": true, + "serviceAccountsEnabled": false, + "publicClient": false, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "saml.assertion.signature": "false", + "saml.force.post.binding": "false", + "saml.multivalued.roles": "false", + "saml.encrypt": "false", + "backchannel.logout.revoke.offline.tokens": "false", + "saml.server.signature": "false", + "saml.server.signature.keyinfo.ext": "false", + "exclude.session.state.from.auth.response": "false", + "backchannel.logout.session.required": "true", + "client_credentials.use_refresh_token": "false", + "saml_force_name_id_format": "false", + "saml.client.signature": "false", + "tls.client.certificate.bound.access.tokens": "false", + "saml.authnstatement": "false", + "display.on.consent.screen": "false", + "saml.onetimeuse.condition": "false" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": true, + "nodeReRegistrationTimeout": -1, + "protocolMappers": [ + { + "id": "81acdbca-a75c-430d-8b1b-4f0883efec26", + "name": "client roles", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-client-role-mapper", + "consentRequired": false, + "config": { + "multivalued": "true", + "userinfo.token.claim": "true", + "user.attribute": "foo", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "roles", + "jsonType.label": "String", + "usermodel.clientRoleMapping.clientId": "GestionEPA" + } + } + ], + "defaultClientScopes": [ + "web-origins", + "role_list", + "profile", + "roles", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "48732f8d-4a42-4e84-a948-36826c4ae908", + "clientId": "account", + "name": "${client_account}", + "rootUrl": "${authBaseUrl}", + "baseUrl": "/realms/Apside/account/", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "secret": "**********", + "defaultRoles": [ + "manage-account", + "view-profile" + ], + "redirectUris": [ + "/realms/Apside/account/*" + ], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "serviceAccountsEnabled": false, + "publicClient": false, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": {}, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": false, + "nodeReRegistrationTimeout": 0, + "defaultClientScopes": [ + "web-origins", + "role_list", + "profile", + "roles", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "70c8cd7e-850b-4a6e-b95c-3744b06f0fc1", + "clientId": "account-console", + "name": "${client_account-console}", + "rootUrl": "${authBaseUrl}", + "baseUrl": "/realms/Apside/account/", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "secret": "**********", + "redirectUris": [ + "/realms/Apside/account/*" + ], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "pkce.code.challenge.method": "S256" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": false, + "nodeReRegistrationTimeout": 0, + "protocolMappers": [ + { + "id": "0ba5b81a-4eeb-43f6-8ade-37aadb09c19f", + "name": "audience resolve", + "protocol": "openid-connect", + "protocolMapper": "oidc-audience-resolve-mapper", + "consentRequired": false, + "config": {} + } + ], + "defaultClientScopes": [ + "web-origins", + "role_list", + "profile", + "roles", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "4c73a756-a461-40b6-9405-0ff2cbdd4f89", + "clientId": "admin-cli", + "name": "${client_admin-cli}", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "secret": "**********", + "redirectUris": [], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": false, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": true, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": {}, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": false, + "nodeReRegistrationTimeout": 0, + "defaultClientScopes": [ + "web-origins", + "role_list", + "profile", + "roles", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "f91cfb3d-aa60-42d6-b1ae-1f9b2d9243ce", + "clientId": "broker", + "name": "${client_broker}", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "secret": "**********", + "redirectUris": [], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "serviceAccountsEnabled": false, + "publicClient": false, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": {}, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": false, + "nodeReRegistrationTimeout": 0, + "defaultClientScopes": [ + "web-origins", + "role_list", + "profile", + "roles", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "c8b1d33c-921e-43ad-be8d-65a73556b67c", + "clientId": "realm-management", + "name": "${client_realm-management}", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "secret": "**********", + "redirectUris": [], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": true, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "serviceAccountsEnabled": false, + "publicClient": false, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": {}, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": false, + "nodeReRegistrationTimeout": 0, + "defaultClientScopes": [ + "web-origins", + "role_list", + "profile", + "roles", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "7abcd969-075a-4d7b-a3bd-b5e545bc8b15", + "clientId": "security-admin-console", + "name": "${client_security-admin-console}", + "rootUrl": "${authAdminUrl}", + "baseUrl": "/admin/Apside/console/", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "secret": "**********", + "redirectUris": [ + "/admin/Apside/console/*" + ], + "webOrigins": [ + "+" + ], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "pkce.code.challenge.method": "S256" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": false, + "nodeReRegistrationTimeout": 0, + "protocolMappers": [ + { + "id": "f61a9f4b-6396-4bc9-8e64-e57e0aeba959", + "name": "locale", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "locale", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "locale", + "jsonType.label": "String" + } + } + ], + "defaultClientScopes": [ + "web-origins", + "role_list", + "profile", + "roles", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + } + ], + "clientScopes": [ + { + "id": "e01bff73-e1c4-4142-a9b8-96c62f26671d", + "name": "address", + "description": "OpenID Connect built-in scope: address", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "true", + "display.on.consent.screen": "true", + "consent.screen.text": "${addressScopeConsentText}" + }, + "protocolMappers": [ + { + "id": "3b6927c5-b698-4e42-9fb4-e977dc14a948", + "name": "address", + "protocol": "openid-connect", + "protocolMapper": "oidc-address-mapper", + "consentRequired": false, + "config": { + "user.attribute.formatted": "formatted", + "user.attribute.country": "country", + "user.attribute.postal_code": "postal_code", + "userinfo.token.claim": "true", + "user.attribute.street": "street", + "id.token.claim": "true", + "user.attribute.region": "region", + "access.token.claim": "true", + "user.attribute.locality": "locality" + } + } + ] + }, + { + "id": "c10fc678-4dae-4586-b8bc-596626172416", + "name": "email", + "description": "OpenID Connect built-in scope: email", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "true", + "display.on.consent.screen": "true", + "consent.screen.text": "${emailScopeConsentText}" + }, + "protocolMappers": [ + { + "id": "56594ad3-dcc0-4cac-9b0d-2185f49d49e7", + "name": "email verified", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-property-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "emailVerified", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "email_verified", + "jsonType.label": "boolean" + } + }, + { + "id": "674986fd-ed5b-4ec6-b3e5-d9a0ab06f7a7", + "name": "email", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-property-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "email", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "email", + "jsonType.label": "String" + } + } + ] + }, + { + "id": "392abf7d-dbd0-4da1-bf77-8f91095be8db", + "name": "microprofile-jwt", + "description": "Microprofile - JWT built-in scope", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "true", + "display.on.consent.screen": "false" + }, + "protocolMappers": [ + { + "id": "2d733fdd-0f07-46ed-9271-818a419674f7", + "name": "upn", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-property-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "username", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "upn", + "jsonType.label": "String" + } + }, + { + "id": "4f6c72ac-1e08-4318-bc89-06af309b7a16", + "name": "groups", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-realm-role-mapper", + "consentRequired": false, + "config": { + "multivalued": "true", + "user.attribute": "foo", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "groups", + "jsonType.label": "String" + } + } + ] + }, + { + "id": "a70ed939-0a0e-4b43-b0a9-27599b5800a7", + "name": "offline_access", + "description": "OpenID Connect built-in scope: offline_access", + "protocol": "openid-connect", + "attributes": { + "consent.screen.text": "${offlineAccessScopeConsentText}", + "display.on.consent.screen": "true" + } + }, + { + "id": "e4f69321-d1ae-4a91-b552-7c0ec2110d86", + "name": "phone", + "description": "OpenID Connect built-in scope: phone", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "true", + "display.on.consent.screen": "true", + "consent.screen.text": "${phoneScopeConsentText}" + }, + "protocolMappers": [ + { + "id": "5c3929d3-709a-4b7a-b203-de98d0102562", + "name": "phone number", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "phoneNumber", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "phone_number", + "jsonType.label": "String" + } + }, + { + "id": "15b82425-a466-4ee3-af3e-41bc5a9936f2", + "name": "phone number verified", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "phoneNumberVerified", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "phone_number_verified", + "jsonType.label": "boolean" + } + } + ] + }, + { + "id": "bbfbd9a4-69fa-4905-921f-062d3653b007", + "name": "profile", + "description": "OpenID Connect built-in scope: profile", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "true", + "display.on.consent.screen": "true", + "consent.screen.text": "${profileScopeConsentText}" + }, + "protocolMappers": [ + { + "id": "105ee8a3-6236-45e1-9c98-5ff7ad2462f2", + "name": "middle name", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "middleName", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "middle_name", + "jsonType.label": "String" + } + }, + { + "id": "cd616fc0-720a-4de0-879e-0c0b53f59de5", + "name": "nickname", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "nickname", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "nickname", + "jsonType.label": "String" + } + }, + { + "id": "d96f8908-a1f5-4339-97a8-639d3f6fb609", + "name": "updated at", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "updatedAt", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "updated_at", + "jsonType.label": "String" + } + }, + { + "id": "bb7e0798-29be-4d31-a477-6b1ec55c5d71", + "name": "profile", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "profile", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "profile", + "jsonType.label": "String" + } + }, + { + "id": "37fd3e88-e599-491e-9c5e-628d5761d5d3", + "name": "birthdate", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "birthdate", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "birthdate", + "jsonType.label": "String" + } + }, + { + "id": "718cb9cb-7da1-4b81-a116-6803ec2a02d2", + "name": "given name", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-property-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "firstName", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "given_name", + "jsonType.label": "String" + } + }, + { + "id": "d64d287a-44e9-44bc-a86e-e350d491a467", + "name": "picture", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "picture", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "picture", + "jsonType.label": "String" + } + }, + { + "id": "cfb3c1be-4f6a-4a8d-a948-2869a2b4ae84", + "name": "gender", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "gender", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "gender", + "jsonType.label": "String" + } + }, + { + "id": "af8ec017-bf3e-4866-a2d6-090f553ab9eb", + "name": "full name", + "protocol": "openid-connect", + "protocolMapper": "oidc-full-name-mapper", + "consentRequired": false, + "config": { + "id.token.claim": "true", + "access.token.claim": "true", + "userinfo.token.claim": "true" + } + }, + { + "id": "e1ddf80c-5d11-4747-b868-326b6fd99fa9", + "name": "username", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-property-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "username", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "preferred_username", + "jsonType.label": "String" + } + }, + { + "id": "d1a056a7-6451-4981-ad54-106ef66faaa2", + "name": "website", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "website", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "website", + "jsonType.label": "String" + } + }, + { + "id": "111ef886-dd15-41a2-bf13-461946380e68", + "name": "family name", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-property-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "lastName", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "family_name", + "jsonType.label": "String" + } + }, + { + "id": "d1519196-3925-41f8-b25e-555198b6e6e7", + "name": "zoneinfo", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "zoneinfo", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "zoneinfo", + "jsonType.label": "String" + } + }, + { + "id": "93679b40-dc46-4fb5-98ff-16223c8a68a2", + "name": "locale", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "locale", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "locale", + "jsonType.label": "String" + } + } + ] + }, + { + "id": "1d905756-959c-44d6-88fa-2d11838e666d", + "name": "role_list", + "description": "SAML role list", + "protocol": "saml", + "attributes": { + "consent.screen.text": "${samlRoleListScopeConsentText}", + "display.on.consent.screen": "true" + }, + "protocolMappers": [ + { + "id": "4c725a29-c08b-4da9-8697-e6efc09f2d8c", + "name": "role list", + "protocol": "saml", + "protocolMapper": "saml-role-list-mapper", + "consentRequired": false, + "config": { + "single": "false", + "attribute.nameformat": "Basic", + "attribute.name": "Role" + } + } + ] + }, + { + "id": "cb94fdec-6c1c-4966-906d-ed9d259f4b2b", + "name": "roles", + "description": "OpenID Connect scope for add user roles to the access token", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "false", + "display.on.consent.screen": "true", + "consent.screen.text": "${rolesScopeConsentText}" + }, + "protocolMappers": [ + { + "id": "3b217c23-5dc2-47c1-9386-8a33b86bdec5", + "name": "audience resolve", + "protocol": "openid-connect", + "protocolMapper": "oidc-audience-resolve-mapper", + "consentRequired": false, + "config": {} + }, + { + "id": "35cdb4e5-a94e-46f9-8ae9-c18438c8e0f9", + "name": "client roles", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-client-role-mapper", + "consentRequired": false, + "config": { + "user.attribute": "foo", + "access.token.claim": "true", + "claim.name": "resource_access.${client_id}.roles", + "jsonType.label": "String", + "multivalued": "true" + } + }, + { + "id": "099e9f48-412d-41e1-a566-2ba888a03415", + "name": "realm roles", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-realm-role-mapper", + "consentRequired": false, + "config": { + "user.attribute": "foo", + "access.token.claim": "true", + "claim.name": "realm_access.roles", + "jsonType.label": "String", + "multivalued": "true" + } + } + ] + }, + { + "id": "c7d7e722-c133-4453-9823-8e206fc06457", + "name": "web-origins", + "description": "OpenID Connect scope for add allowed web origins to the access token", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "false", + "display.on.consent.screen": "false", + "consent.screen.text": "" + }, + "protocolMappers": [ + { + "id": "807d84c2-d231-45b6-a722-d0638c569243", + "name": "allowed web origins", + "protocol": "openid-connect", + "protocolMapper": "oidc-allowed-origins-mapper", + "consentRequired": false, + "config": {} + } + ] + } + ], + "defaultDefaultClientScopes": [ + "role_list", + "profile", + "email", + "roles", + "web-origins" + ], + "defaultOptionalClientScopes": [ + "offline_access", + "address", + "phone", + "microprofile-jwt" + ], + "browserSecurityHeaders": { + "contentSecurityPolicyReportOnly": "", + "xContentTypeOptions": "nosniff", + "xRobotsTag": "none", + "xFrameOptions": "SAMEORIGIN", + "contentSecurityPolicy": "frame-src 'self'; frame-ancestors 'self'; object-src 'none';", + "xXSSProtection": "1; mode=block", + "strictTransportSecurity": "max-age=31536000; includeSubDomains" + }, + "smtpServer": {}, + "eventsEnabled": false, + "eventsListeners": [ + "jboss-logging" + ], + "enabledEventTypes": [], + "adminEventsEnabled": false, + "adminEventsDetailsEnabled": false, + "identityProviders": [], + "identityProviderMappers": [], + "components": { + "org.keycloak.services.clientregistration.policy.ClientRegistrationPolicy": [ + { + "id": "e0b0df13-178d-4d20-abc0-026810b6b979", + "name": "Allowed Protocol Mapper Types", + "providerId": "allowed-protocol-mappers", + "subType": "authenticated", + "subComponents": {}, + "config": { + "allowed-protocol-mapper-types": [ + "saml-user-property-mapper", + "oidc-usermodel-attribute-mapper", + "oidc-usermodel-property-mapper", + "oidc-full-name-mapper", + "oidc-sha256-pairwise-sub-mapper", + "oidc-address-mapper", + "saml-user-attribute-mapper", + "saml-role-list-mapper" + ] + } + }, + { + "id": "fd3c548a-28b2-4e4e-a85c-3aae9b347eba", + "name": "Max Clients Limit", + "providerId": "max-clients", + "subType": "anonymous", + "subComponents": {}, + "config": { + "max-clients": [ + "200" + ] + } + }, + { + "id": "9f3db458-e73d-4578-a238-f7751fb9f35e", + "name": "Allowed Protocol Mapper Types", + "providerId": "allowed-protocol-mappers", + "subType": "anonymous", + "subComponents": {}, + "config": { + "allowed-protocol-mapper-types": [ + "saml-role-list-mapper", + "oidc-usermodel-attribute-mapper", + "oidc-usermodel-property-mapper", + "oidc-address-mapper", + "saml-user-property-mapper", + "oidc-sha256-pairwise-sub-mapper", + "oidc-full-name-mapper", + "saml-user-attribute-mapper" + ] + } + }, + { + "id": "17944d3e-78e4-4a70-9624-7e765055ec37", + "name": "Allowed Client Scopes", + "providerId": "allowed-client-templates", + "subType": "anonymous", + "subComponents": {}, + "config": { + "allow-default-scopes": [ + "true" + ] + } + }, + { + "id": "0fc9b82e-bfd4-444f-a3a9-29ee73cac502", + "name": "Trusted Hosts", + "providerId": "trusted-hosts", + "subType": "anonymous", + "subComponents": {}, + "config": { + "host-sending-registration-request-must-match": [ + "true" + ], + "client-uris-must-match": [ + "true" + ] + } + }, + { + "id": "42bfe814-6ce8-462c-9150-ab05e036f02a", + "name": "Allowed Client Scopes", + "providerId": "allowed-client-templates", + "subType": "authenticated", + "subComponents": {}, + "config": { + "allow-default-scopes": [ + "true" + ] + } + }, + { + "id": "d8c9874f-9b79-4893-95c5-ff4deeca87b2", + "name": "Consent Required", + "providerId": "consent-required", + "subType": "anonymous", + "subComponents": {}, + "config": {} + }, + { + "id": "74906353-c315-4a86-980f-bf8e43eea028", + "name": "Full Scope Disabled", + "providerId": "scope", + "subType": "anonymous", + "subComponents": {}, + "config": {} + } + ], + "org.keycloak.keys.KeyProvider": [ + { + "id": "5cc25a59-a206-4d73-8248-d0b3c44387cb", + "name": "aes-generated", + "providerId": "aes-generated", + "subComponents": {}, + "config": { + "priority": [ + "100" + ] + } + }, + { + "id": "2852d1ab-3480-41eb-86e5-621c69080a1b", + "name": "rsa-generated", + "providerId": "rsa-generated", + "subComponents": {}, + "config": { + "priority": [ + "100" + ] + } + }, + { + "id": "b39d0989-9b9a-4b20-91a8-a13c8e7ab0d2", + "name": "hmac-generated", + "providerId": "hmac-generated", + "subComponents": {}, + "config": { + "priority": [ + "100" + ], + "algorithm": [ + "HS256" + ] + } + } + ] + }, + "internationalizationEnabled": false, + "supportedLocales": [], + "authenticationFlows": [ + { + "id": "530cfdb9-aec6-4d3f-abef-a69a6bf02ffc", + "alias": "Account verification options", + "description": "Method with which to verity the existing account", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "idp-email-verification", + "requirement": "ALTERNATIVE", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "requirement": "ALTERNATIVE", + "priority": 20, + "flowAlias": "Verify Existing Account by Re-authentication", + "userSetupAllowed": false, + "autheticatorFlow": true + } + ] + }, + { + "id": "fb764e63-91ee-4f4b-93ee-c26fbb41ce6a", + "alias": "Authentication Options", + "description": "Authentication options.", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "basic-auth", + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "basic-auth-otp", + "requirement": "DISABLED", + "priority": 20, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "auth-spnego", + "requirement": "DISABLED", + "priority": 30, + "userSetupAllowed": false, + "autheticatorFlow": false + } + ] + }, + { + "id": "a0b57e95-a6ba-4588-9e73-d556c6962c6d", + "alias": "Browser - Conditional OTP", + "description": "Flow to determine if the OTP is required for the authentication", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "conditional-user-configured", + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "auth-otp-form", + "requirement": "REQUIRED", + "priority": 20, + "userSetupAllowed": false, + "autheticatorFlow": false + } + ] + }, + { + "id": "df796e97-e24c-4955-9e8c-302fa2c612a6", + "alias": "Direct Grant - Conditional OTP", + "description": "Flow to determine if the OTP is required for the authentication", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "conditional-user-configured", + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "direct-grant-validate-otp", + "requirement": "REQUIRED", + "priority": 20, + "userSetupAllowed": false, + "autheticatorFlow": false + } + ] + }, + { + "id": "6d841a8b-33d4-493d-bb5f-ddec52331338", + "alias": "First broker login - Conditional OTP", + "description": "Flow to determine if the OTP is required for the authentication", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "conditional-user-configured", + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "auth-otp-form", + "requirement": "REQUIRED", + "priority": 20, + "userSetupAllowed": false, + "autheticatorFlow": false + } + ] + }, + { + "id": "8bda3c84-e3fd-4445-bda2-9846e65205fb", + "alias": "Handle Existing Account", + "description": "Handle what to do if there is existing account with same email/username like authenticated identity provider", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "idp-confirm-link", + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "requirement": "REQUIRED", + "priority": 20, + "flowAlias": "Account verification options", + "userSetupAllowed": false, + "autheticatorFlow": true + } + ] + }, + { + "id": "e98fde91-c881-4c9a-aa0b-fe4e682a929b", + "alias": "Reset - Conditional OTP", + "description": "Flow to determine if the OTP should be reset or not. Set to REQUIRED to force.", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "conditional-user-configured", + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "reset-otp", + "requirement": "REQUIRED", + "priority": 20, + "userSetupAllowed": false, + "autheticatorFlow": false + } + ] + }, + { + "id": "573f8790-f56b-4034-ae3b-b06f218ad9a1", + "alias": "User creation or linking", + "description": "Flow for the existing/non-existing user alternatives", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticatorConfig": "create unique user config", + "authenticator": "idp-create-user-if-unique", + "requirement": "ALTERNATIVE", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "requirement": "ALTERNATIVE", + "priority": 20, + "flowAlias": "Handle Existing Account", + "userSetupAllowed": false, + "autheticatorFlow": true + } + ] + }, + { + "id": "e4056f93-68ad-4d06-b27a-55cf60cd26ca", + "alias": "Verify Existing Account by Re-authentication", + "description": "Reauthentication of existing account", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "idp-username-password-form", + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "requirement": "CONDITIONAL", + "priority": 20, + "flowAlias": "First broker login - Conditional OTP", + "userSetupAllowed": false, + "autheticatorFlow": true + } + ] + }, + { + "id": "d85f2c8b-3877-47f8-9def-a76573a4be7e", + "alias": "browser", + "description": "browser based authentication", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "auth-cookie", + "requirement": "ALTERNATIVE", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "auth-spnego", + "requirement": "DISABLED", + "priority": 20, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "identity-provider-redirector", + "requirement": "ALTERNATIVE", + "priority": 25, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "requirement": "ALTERNATIVE", + "priority": 30, + "flowAlias": "forms", + "userSetupAllowed": false, + "autheticatorFlow": true + } + ] + }, + { + "id": "18e1e883-d1c9-4763-afdf-e3f7575bd930", + "alias": "clients", + "description": "Base authentication for clients", + "providerId": "client-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "client-secret", + "requirement": "ALTERNATIVE", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "client-jwt", + "requirement": "ALTERNATIVE", + "priority": 20, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "client-secret-jwt", + "requirement": "ALTERNATIVE", + "priority": 30, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "client-x509", + "requirement": "ALTERNATIVE", + "priority": 40, + "userSetupAllowed": false, + "autheticatorFlow": false + } + ] + }, + { + "id": "0e7a6a05-f9b0-4022-9a2e-97c8cbe9fb5e", + "alias": "direct grant", + "description": "OpenID Connect Resource Owner Grant", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "direct-grant-validate-username", + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "direct-grant-validate-password", + "requirement": "REQUIRED", + "priority": 20, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "requirement": "CONDITIONAL", + "priority": 30, + "flowAlias": "Direct Grant - Conditional OTP", + "userSetupAllowed": false, + "autheticatorFlow": true + } + ] + }, + { + "id": "4ecce4db-7ebb-41b4-a45f-45a4fe2ab48a", + "alias": "docker auth", + "description": "Used by Docker clients to authenticate against the IDP", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "docker-http-basic-authenticator", + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + } + ] + }, + { + "id": "763e0fab-8c3b-44c4-aa33-47cef592ce89", + "alias": "first broker login", + "description": "Actions taken after first broker login with identity provider account, which is not yet linked to any Keycloak account", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticatorConfig": "review profile config", + "authenticator": "idp-review-profile", + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "requirement": "REQUIRED", + "priority": 20, + "flowAlias": "User creation or linking", + "userSetupAllowed": false, + "autheticatorFlow": true + } + ] + }, + { + "id": "fa02e8cd-a361-4bc2-adf7-be75d4cd1079", + "alias": "forms", + "description": "Username, password, otp and other auth forms.", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "auth-username-password-form", + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "requirement": "CONDITIONAL", + "priority": 20, + "flowAlias": "Browser - Conditional OTP", + "userSetupAllowed": false, + "autheticatorFlow": true + } + ] + }, + { + "id": "e4fc9bf1-a941-43a7-adf6-ad39879db1f3", + "alias": "http challenge", + "description": "An authentication flow based on challenge-response HTTP Authentication Schemes", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "no-cookie-redirect", + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "requirement": "REQUIRED", + "priority": 20, + "flowAlias": "Authentication Options", + "userSetupAllowed": false, + "autheticatorFlow": true + } + ] + }, + { + "id": "d3e1f056-5d97-481b-a995-bf1bcb0f9e2c", + "alias": "registration", + "description": "registration flow", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "registration-page-form", + "requirement": "REQUIRED", + "priority": 10, + "flowAlias": "registration form", + "userSetupAllowed": false, + "autheticatorFlow": true + } + ] + }, + { + "id": "0a241d7a-2629-4ddc-8cc9-7a599b9e8ed5", + "alias": "registration form", + "description": "registration form", + "providerId": "form-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "registration-user-creation", + "requirement": "REQUIRED", + "priority": 20, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "registration-profile-action", + "requirement": "REQUIRED", + "priority": 40, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "registration-password-action", + "requirement": "REQUIRED", + "priority": 50, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "registration-recaptcha-action", + "requirement": "DISABLED", + "priority": 60, + "userSetupAllowed": false, + "autheticatorFlow": false + } + ] + }, + { + "id": "31d44fad-f433-4ae0-af23-539da35fcddb", + "alias": "reset credentials", + "description": "Reset credentials for a user if they forgot their password or something", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "reset-credentials-choose-user", + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "reset-credential-email", + "requirement": "REQUIRED", + "priority": 20, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "reset-password", + "requirement": "REQUIRED", + "priority": 30, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "requirement": "CONDITIONAL", + "priority": 40, + "flowAlias": "Reset - Conditional OTP", + "userSetupAllowed": false, + "autheticatorFlow": true + } + ] + }, + { + "id": "a79cb5ad-724f-4fe1-a406-6ee7e9e22b9f", + "alias": "saml ecp", + "description": "SAML ECP Profile Authentication Flow", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "http-basic-authenticator", + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + } + ] + } + ], + "authenticatorConfig": [ + { + "id": "bcf16ba9-f5da-4451-8fc9-b335d096d9a6", + "alias": "create unique user config", + "config": { + "require.password.update.after.registration": "false" + } + }, + { + "id": "e4c0208d-6fc4-4fa0-a7d3-c06c82c32e18", + "alias": "review profile config", + "config": { + "update.profile.on.first.login": "missing" + } + } + ], + "requiredActions": [ + { + "alias": "CONFIGURE_TOTP", + "name": "Configure OTP", + "providerId": "CONFIGURE_TOTP", + "enabled": true, + "defaultAction": false, + "priority": 10, + "config": {} + }, + { + "alias": "terms_and_conditions", + "name": "Terms and Conditions", + "providerId": "terms_and_conditions", + "enabled": false, + "defaultAction": false, + "priority": 20, + "config": {} + }, + { + "alias": "UPDATE_PASSWORD", + "name": "Update Password", + "providerId": "UPDATE_PASSWORD", + "enabled": true, + "defaultAction": false, + "priority": 30, + "config": {} + }, + { + "alias": "UPDATE_PROFILE", + "name": "Update Profile", + "providerId": "UPDATE_PROFILE", + "enabled": true, + "defaultAction": false, + "priority": 40, + "config": {} + }, + { + "alias": "VERIFY_EMAIL", + "name": "Verify Email", + "providerId": "VERIFY_EMAIL", + "enabled": true, + "defaultAction": false, + "priority": 50, + "config": {} + }, + { + "alias": "delete_account", + "name": "Delete Account", + "providerId": "delete_account", + "enabled": false, + "defaultAction": false, + "priority": 60, + "config": {} + }, + { + "alias": "update_user_locale", + "name": "Update User Locale", + "providerId": "update_user_locale", + "enabled": true, + "defaultAction": false, + "priority": 1000, + "config": {} + } + ], + "browserFlow": "browser", + "registrationFlow": "registration", + "directGrantFlow": "direct grant", + "resetCredentialsFlow": "reset credentials", + "clientAuthenticationFlow": "clients", + "dockerAuthenticationFlow": "docker auth", + "attributes": {}, + "keycloakVersion": "12.0.2", + "userManagedAccessAllowed": false +} \ No newline at end of file diff --git a/scripts/restart.sh b/scripts/restart.sh new file mode 100644 index 0000000..4233218 --- /dev/null +++ b/scripts/restart.sh @@ -0,0 +1,3 @@ +docker stop digitepa_front +docker rm digitepa_front +docker-compose up -d \ No newline at end of file diff --git a/scripts/restart.txt b/scripts/restart.txt new file mode 100644 index 0000000..ceafeb9 --- /dev/null +++ b/scripts/restart.txt @@ -0,0 +1,4 @@ +docker stop digitepa_front +docker rm digitepa_front +docker volume rm 2-env_dev_ep-db +docker-compose up -d \ No newline at end of file diff --git a/sql/init-sql.sql b/sql/init-sql.sql new file mode 100644 index 0000000..aab4247 --- /dev/null +++ b/sql/init-sql.sql @@ -0,0 +1,286 @@ +CREATE TABLE Ep( + IdEP INT, + IdCollaborateur VARCHAR(500) NOT NULL, + IdReferent VARCHAR(500) NOT NULL, + IdAgence INT, + IdBU INT, + Fonction VARCHAR(50), + TypeEp VARCHAR(3) NOT NULL, + NumeroEp INT, + Obligatoire BOOL, + Statut VARCHAR(50) NOT NULL, + CV VARCHAR(50), + DateCreation DATETIME NOT NULL, + DatePrevisionnelle DATE, + DateDisponibilite DATE, + DateSaisie DATETIME, + DateMiseAJour DATETIME, + DateSignatureCollaborateur DATETIME, + DateSignatureReferent DATETIME, + DemandeEPI INT NOT NULL, + AugmentationSalaire INT NOT NULL, + DemandeDelegation INT NOT NULL, + RdvEntretien INT NOT NULL, + PRIMARY KEY(IdEP) +); + +CREATE TABLE Engagement( + IdEngagement BIGINT, + Action VARCHAR(500) NOT NULL, + Dispositif VARCHAR(50) NOT NULL, + Modalite VARCHAR(50), + DateLimite DATE, + EtatEngagement INT NOT NULL, + RaisonNonRealisable VARCHAR(50), + Id_1 INT NOT NULL, + PRIMARY KEY(Id), + FOREIGN KEY(Id_1) REFERENCES Ep(IdEP) + FOREIGN KEY(Id_1) REFERENCES Ep(EtatEngagement) +); + +CREATE TABLE Note( + Id INT, + Titre VARCHAR(50), + Texte VARCHAR(500), + IdAuteur VARCHAR(50) NOT NULL, + IdCollaborateur VARCHAR(500) NOT NULL, + PRIMARY KEY(Id) +); + +CREATE TABLE ParticipationEp( + Id VARCHAR(50), + IdPersonne VARCHAR(50), + Id_1 INT NOT NULL, + PRIMARY KEY(Id), + FOREIGN KEY(Id_1) REFERENCES Ep(IdEP) +); + +CREATE TABLE Theme( + Id INT, + Nom VARCHAR(50) NOT NULL, + PRIMARY KEY(Id) +); + +CREATE TABLE AugmentationSalaire( + IdAugmentationSalaire INT, + Augmentation DECIMAL(15,2) NOT NULL, + PrimeMission DECIMAL(15,2), + Message VARCHAR(50), + Id_1 INT NOT NULL, + PRIMARY KEY(IdAugmentationSalaire), + UNIQUE(Id_1), + FOREIGN KEY(Id_1) REFERENCES Ep(IdEP) +); + +CREATE TABLE Champ( + Id INT, + Texte VARCHAR(100) NOT NULL, + Section VARCHAR(100) NOT NULL, + SousSection VARCHAR(50), + Ordre VARCHAR(100) NOT NULL, + TypeChamp INT NOT NULL, + TypeSaisie VARCHAR(50) NOT NULL, + PRIMARY KEY(Id) +); + +CREATE TABLE Document( + IdDocument INT, + TypeDocument VARCHAR(50) NOT NULL, + Id_1 INT NOT NULL, + PRIMARY KEY(IdDocument), + FOREIGN KEY(Id_1) REFERENCES Ep(IdEP) +); + +CREATE TABLE DemandeDelegation( + IdDemandeDelegation INT, + IdReferent VARCHAR(500) NOT NULL, + DateDemande DATETIME NOT NULL, + RaisonDemande VARCHAR(50), + Reponse BOOL, + DateReponse DATETIME, + RaisonRefus VARCHAR(500), + EpIdEP INT NOT NULL, + PRIMARY KEY(IdDemandeDelegation), + UNIQUE(EpIdEP), + FOREIGN KEY(EpIdEP) REFERENCES Ep(IdEP) +); + +CREATE TABLE StatutFormation( + IdStatutFormation INT, + Libelle VARCHAR(50) NOT NULL, + PRIMARY KEY(IdStatutFormation), + UNIQUE(Libelle) +); + +CREATE TABLE TypeEntretien( + IdTypeEntretien INT, + Libelle VARCHAR(50), + PRIMARY KEY(IdTypeEntretien), + UNIQUE(Libelle) +); + +CREATE TABLE ObjectifPrecedent( + IdObjectif INT, + Libelle VARCHAR(50), + Atteint VARCHAR(50), + Commentaire VARCHAR(50), + EpIdEP INT NOT NULL, + PRIMARY KEY(IdObjectif), + FOREIGN KEY(EpIdEP) REFERENCES Ep(IdEP) +); + +CREATE TABLE Objectif( + IdObjectif INT, + Libelle VARCHAR(50), + EpIdEP INT NOT NULL, + PRIMARY KEY(Id), + FOREIGN KEY(EpIdEP) REFERENCES Ep(IdEP) +); + +CREATE TABLE OrigineFormation( + IdOrigineFormation INT, + Libelle VARCHAR(50) NOT NULL, + PRIMARY KEY(IdOrigineFormation), + UNIQUE(Libelle) +); + +CREATE TABLE OrigineDemande( + IdOrigineDemande INT, + Libelle VARCHAR(50) NOT NULL, + PRIMARY KEY(IdOrigineDemande), + UNIQUE(Libelle) +); + +CREATE TABLE TypeFormation( + IdTypeFormation VARCHAR(50), + Libelle VARCHAR(50) NOT NULL, + PRIMARY KEY(IdTypeFormation), + UNIQUE(Libelle) +); + +CREATE TABLE ModeFormation( + IdModeFormation INT, + Libelle VARCHAR(50) NOT NULL, + PRIMARY KEY(IdModeFormation), + UNIQUE(Libelle) +); + +CREATE TABLE DemandeEpI( + IdDemandeEPI INT, + IdCollaborateur VARCHAR(50) NOT NULL, + IdReferent VARCHAR(50) NOT NULL, + DateDemande DATETIME, + RaisonRefus VARCHAR(50), + DateReponse DATETIME, + Etat INT, + Reponse BOOL, + EpIdEP INT, + PRIMARY KEY(IdDemandeEPI), + UNIQUE(EpIdEP), + FOREIGN KEY(EpIdEP) REFERENCES Ep(IdEP) +); + +CREATE TABLE CommentaireAssistante( + IdCommentaireAssistant INT, + idAssistante VARCHAR(50) NOT NULL, + dateCommentaire DATETIME NOT NULL, + commentaire VARCHAR(50) NOT NULL, + EpIdEP INT NOT NULL, + PRIMARY KEY(IdCommentaireAssistant), + FOREIGN KEY(EpIdEP) REFERENCES Ep(IdEP) +); + +CREATE TABLE RdvEntretien( + IdRdvEntretien INT, + DateEntretien DATETIME NOT NULL, + EpIdEP INT NOT NULL, + TypeEntretienIdTypeEntretien INT NOT NULL, + EpIdEP INT NOT NULL, + PRIMARY KEY(IdRdvEntretien), + UNIQUE(EpIdEP), + FOREIGN KEY(EpIdEP) REFERENCES Ep(IdEP), + FOREIGN KEY(TypeEntretienIdTypeEntretien) REFERENCES TypeEntretien(IdTypeEntretien), + FOREIGN KEY(EpIdEP) REFERENCES Ep(IdEP) +); + +CREATE TABLE Formation( + IdFormation INT, + Intitule VARCHAR(50), + DateDebut DATETIME, + DateFin DATETIME, + IdAgence INT NOT NULL, + Heure INT, + Jour INT NOT NULL, + Organisme VARCHAR(50), + EstCertifiee BOOL NOT NULL, + EstRealisee BOOL NOT NULL, + ModeFormationIdModeFormation INT NOT NULL, + TypeFormationIdTypeFormation VARCHAR(50) NOT NULL, + OrigineIdOrigineFormation INT NOT NULL, + StatutIdStatutFormation INT NOT NULL, + PRIMARY KEY(IdFormation), + FOREIGN KEY(ModeFormationIdModeFormation) REFERENCES ModeFormation(IdModeFormation), + FOREIGN KEY(TypeFormationIdTypeFormation) REFERENCES TypeFormation(IdTypeFormation), + FOREIGN KEY(OrigineIdOrigineFormation) REFERENCES OrigineFormation(IdOrigineFormation), + FOREIGN KEY(StatutIdStatutFormation) REFERENCES StatutFormation(IdStatutFormation) +); + +CREATE TABLE DemandeFormation( + IdDemandeFormation INT, + Libelle VARCHAR(50) NOT NULL, + Description VARCHAR(50), + DemandeRH BOOL, + DateDemande VARCHAR(50), + Etat INT, + CommentaireRefus VARCHAR(50), + DateDerniereReponse DATETIME, + OrigineDemandeIdOrigineDemande INT NOT NULL, + EpIdEP INT NOT NULL, + PRIMARY KEY(IdDemandeFormation), + FOREIGN KEY(OrigineDemandeIdOrigineDemande) REFERENCES OrigineDemande(Id), + FOREIGN KEY(EpIdEP) REFERENCES Ep(IdEP) +); + +CREATE TABLE ParticipationFormation( + IdParticipationFormation INT, + DateCreation DATETIME NOT NULL, + EstEvaluee BOOL NOT NULL, + IdDemandeFormation INT NOT NULL, + FormationIdFormation INT NOT NULL, + PRIMARY KEY(IdParticipationFormation), + UNIQUE(IdParticipationFormation), + FOREIGN KEY(IdDemandeFormation) REFERENCES DemandeFormation(IdDemandeFormation), + FOREIGN KEY(FormationIdFormation) REFERENCES Formation(IdFormation) +); + +CREATE TABLE Saisie( + IdSaisie INT, + Note INT, + Texte VARCHAR(50), + Texte2 VARCHAR(50), + Niveau VARCHAR(50), + TypeSaisie INT NOT NULL, + ParticipationFormationIdParticipationFormation INT, + DocumentIdDocument INT, + ChampIdChamp INT NOT NULL, + PRIMARY KEY(IdSaisie), + FOREIGN KEY(ParticipationFormationIdParticipationFormation) REFERENCES ParticipationFormation(IdParticipationFormation), + FOREIGN KEY(DocumentIdDocument) REFERENCES Document(IdDocument), + FOREIGN KEY(ChampIdChamp) REFERENCES Champ(IdChamp) +); + +CREATE TABLE ChoisirTypeEntretien( + IdChoixTypeEntretien INT, + EpIdEP INT, + Ordre INT NOT NULL, + TypeEntretienIdTypeEntretien INT NOT NULL; + PRIMARY KEY(IdChoixTypeEntretien, EpIdEP), + FOREIGN KEY(EpIdEP) REFERENCES Ep(IdEP), + FOREIGN KEY(TypeEntretienIdTypeEntretien) REFERENCES TypeEntretien(IdTypeEntretien) +); + +ALTER TABLE Ep ADD FOREIGN KEY(DemandeEPIIdDemandeEPI) REFERENCES DemandeEpI(IdDemandeEPI); +ALTER TABLE Ep ADD FOREIGN KEY(AugmentationSalaireIdAugmentationSalaire) REFERENCES AugmentationSalaire(IdAugmentationSalaire); +ALTER TABLE Ep ADD FOREIGN KEY(DemandeDelegationIdDemandeDelegation) REFERENCES DemandeDelegation(IdDemandeDelegation); +ALTER TABLE Ep ADD FOREIGN KEY(RdvEntretienIdRdvEntretien) REFERENCES RdvEntretien(IdRdvEntretien); +ALTER TABLE Ep ADD FOREIGN KEY(DemandeDelegation) REFERENCES RdvEntretien(IdRdvEntretien);