From cb826b1b6ba02ed808091331eff28733e62e26c3 Mon Sep 17 00:00:00 2001 From: Jannik Becker Date: Sun, 19 Jan 2025 11:55:28 +0100 Subject: [PATCH] fix: wrong keycloak client name for authentication --- demo_scripts/fill_with_demo_data.py | 16 ++++++++-------- demo_scripts/get_session_token.py | 12 ++++++------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/demo_scripts/fill_with_demo_data.py b/demo_scripts/fill_with_demo_data.py index 1af33dc..6316bae 100644 --- a/demo_scripts/fill_with_demo_data.py +++ b/demo_scripts/fill_with_demo_data.py @@ -16,7 +16,7 @@ data = { "grant_type": "password", - "client_id": "gits-frontend", + "client_id": "frontend", "username": user_name, "password": user_password } @@ -172,7 +172,7 @@ type: MEDIA, rewardPoints: 1, suggestedDate: "2023-06-10T12:39:12.365Z", - chapterId: $chapter1Id + chapterId: $chapter1Id } }) { id } cheatSheetContent: createMediaContent(input: { @@ -190,7 +190,7 @@ type: MEDIA, rewardPoints: 1, suggestedDate: "2023-06-10T12:39:12.365Z", - chapterId: $chapter2Id + chapterId: $chapter2Id } }) { id } } @@ -258,13 +258,13 @@ flashcardSetInput: { flashcards: [ { sides: [ - { + { label: "Question", text: "What is a *string*?", isQuestion: true, isAnswer: false }, - { + { label: "Answer", text: "A sequence of text characters.", isQuestion: false, @@ -272,9 +272,9 @@ } ] }, { sides: [ - { - label: "Question", - text: "What is a *char*?", + { + label: "Question", + text: "What is a *char*?", isQuestion: true, isAnswer: false }, diff --git a/demo_scripts/get_session_token.py b/demo_scripts/get_session_token.py index e58a053..b2ffcc4 100644 --- a/demo_scripts/get_session_token.py +++ b/demo_scripts/get_session_token.py @@ -39,7 +39,7 @@ def get_auth_token(user_name: str = None, user_password: str = None, use_local: data = { "grant_type": "password", - "client_id": "gits-frontend", + "client_id": "frontend", "username": user_name, "password": user_password } @@ -68,16 +68,16 @@ def get_auth_token(user_name: str = None, user_password: str = None, use_local: parser.add_argument("--username", help="Usernameo of the user to connect with.") parser.add_argument("--password", help="Password of the user to connect with.") parser.add_argument("--copy-to-clipboard", action="store_true", dest="copy_to_clipboard", help="Copy the authorization header to the clipboard.") - + args = parser.parse_args() - + user_token = get_auth_token(args.username, args.password, args.use_local) - + print("Your user token:") print(user_token) - + auth_header = "{ \"authorization\": \"" + user_token + "\" }" - + # copy to clipboard if(args.copy_to_clipboard): pyperclip.copy(auth_header)