Use client-secret to authenticate

This commit is contained in:
hibobmaster 2023-11-15 22:42:02 +08:00
parent 1fc579ee5b
commit 7f5604cd2a
Signed by: bobmaster
SSH key fingerprint: SHA256:5ZYgd8fg+PcNZNy4SzcSKu5JtqZyBF8kUhY7/k2viDk
2 changed files with 6 additions and 6 deletions

View file

@ -1,8 +1,8 @@
{ {
"turnstile_secret_key": "1x0000000000000000000000000000000AA", "turnstile_secret_key": "1x0000000000000000000000000000000AA",
"keycloak_server_url": "xxxxxxxxx", "keycloak_server_url": "xxxxxxxxx",
"keycloak_admin_username": "xxxxxxx", "keycloak_client_id": "admin-cli",
"keycloak_admin_password": "xxxxxxxx", "keycloak_client_secret_key": "xxxxxxx",
"keycloak_realm_name": "master", "keycloak_realm_name": "master",
"open_registration": true "open_registration": true
} }

View file

@ -81,16 +81,16 @@ with open("config.json", "r") as f:
config = json.load(f) config = json.load(f)
turnstile_secret_key = config["turnstile_secret_key"] turnstile_secret_key = config["turnstile_secret_key"]
keycloak_server_url = config["keycloak_server_url"] keycloak_server_url = config["keycloak_server_url"]
keycloak_admin_username = config["keycloak_admin_username"] keycloak_client_id = config["keycloak_client_id"]
keycloak_admin_password = config["keycloak_admin_password"] keycloak_client_secret_key = config["keycloak_client_secret_key"]
keycloak_realm_name = config["keycloak_realm_name"] keycloak_realm_name = config["keycloak_realm_name"]
open_registration = config["open_registration"] open_registration = config["open_registration"]
keycloak_connection = KeycloakOpenIDConnection( keycloak_connection = KeycloakOpenIDConnection(
server_url=keycloak_server_url, server_url=keycloak_server_url,
username=keycloak_admin_username,
password=keycloak_admin_password,
realm_name=keycloak_realm_name, realm_name=keycloak_realm_name,
client_id=keycloak_client_id,
client_secret_key=keycloak_client_secret_key,
verify=True, verify=True,
) )