diff --git a/roles/authelia-for-owncloud/tasks/main.json b/roles/authelia-for-owncloud/tasks/main.json index 1272bc8..7ddcc45 100644 --- a/roles/authelia-for-owncloud/tasks/main.json +++ b/roles/authelia-for-owncloud/tasks/main.json @@ -1,4 +1,28 @@ [ + { + "name": "configuration | compute client secret hash | web", + "become": true, + "ansible.builtin.shell": { + "cmd": "authelia crypto hash generate bcrypt --password {{var_authelia_for_owncloud_web_client_secret}} | cut --delimiter=' ' --fields='2-'" + }, + "register": "temp_authelia_for_owncloud_web_client_secret_hashed" + }, + { + "name": "configuration | compute client secret hash | android", + "become": true, + "ansible.builtin.shell": { + "cmd": "authelia crypto hash generate bcrypt --password {{var_authelia_for_owncloud_android_client_secret}} | cut --delimiter=' ' --fields='2-'" + }, + "register": "temp_authelia_for_owncloud_android_client_secret_hashed" + }, + { + "name": "configuration | compute client secret hash | ios", + "become": true, + "ansible.builtin.shell": { + "cmd": "authelia crypto hash generate bcrypt --password {{var_authelia_for_owncloud_ios_client_secret}} | cut --delimiter=' ' --fields='2-'" + }, + "register": "temp_authelia_for_owncloud_ios_client_secret_hashed" + }, { "name": "configuration | emplace", "become": true, diff --git a/roles/authelia-for-owncloud/templates/authelia-client-conf-android.json.j2 b/roles/authelia-for-owncloud/templates/authelia-client-conf-android.json.j2 index fab1372..a843b9f 100644 --- a/roles/authelia-for-owncloud/templates/authelia-client-conf-android.json.j2 +++ b/roles/authelia-for-owncloud/templates/authelia-client-conf-android.json.j2 @@ -1,6 +1,6 @@ { "client_id": "{{var_authelia_for_owncloud_android_client_id}}", - "client_secret": "{{var_authelia_for_owncloud_android_client_secret}}", + "client_secret": "{{temp_authelia_for_owncloud_android_client_secret_hashed.stdout}}", "client_name": "ownCloud | Android Client", "authorization_policy": "one_factor", "scopes": [ diff --git a/roles/authelia-for-owncloud/templates/authelia-client-conf-ios.json.j2 b/roles/authelia-for-owncloud/templates/authelia-client-conf-ios.json.j2 index ce465a9..5396bd5 100644 --- a/roles/authelia-for-owncloud/templates/authelia-client-conf-ios.json.j2 +++ b/roles/authelia-for-owncloud/templates/authelia-client-conf-ios.json.j2 @@ -1,6 +1,6 @@ { "client_id": "{{var_authelia_for_owncloud_ios_client_id}}", - "client_secret": "{{var_authelia_for_owncloud_ios_client_secret}}", + "client_secret": "{{temp_authelia_for_owncloud_ios_client_secret_hashed.stdout}}", "client_name": "ownCloud | iOS Client", "authorization_policy": "one_factor", "scopes": [