From 65b8b20a24ac6cbce7572f173844d21d4bff0bfc Mon Sep 17 00:00:00 2001 From: Peter Motzko Date: Fri, 30 Jun 2023 10:40:47 +0200 Subject: [PATCH] feat(devel): script to obtain an authority token from keycloak --- dev-assets/get_Token.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 dev-assets/get_Token.sh diff --git a/dev-assets/get_Token.sh b/dev-assets/get_Token.sh new file mode 100755 index 000000000..de719990f --- /dev/null +++ b/dev-assets/get_Token.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# +# /******************************************************************************** +# Copyright (c) 2021,2023 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License, Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ********************************************************************************/ +# + +curl --location 'http://localhost:8080/realms/miw_test/protocol/openid-connect/token' \ + --header 'Content-Type: application/x-www-form-urlencoded' \ + --data-urlencode 'client_id=miw_private_client' \ + --data-urlencode 'client_secret=miw_private_client' \ + --data-urlencode 'grant_type=password' \ + --data-urlencode 'username=catena-x' \ + --data-urlencode 'password=password' \ + | jq -r '.access_token' \ No newline at end of file