Skip to content
Snippets Groups Projects
Verified Commit b35b4e72 authored by Mark's avatar Mark
Browse files

Refactor hydra client script

parent 05862ff5
No related branches found
No related tags found
1 merge request!5Service Integration
Pipeline #639 failed with stages
in 10 minutes and 18 seconds
......@@ -170,7 +170,7 @@ behave-integration:
- /bin/bash user-panel/utils/create-role.bash ${ROLE} backend:5000
- /bin/bash user-panel/utils/grant-access.bash ${TESTUSER_USERNAME} ${KEY} backend:5000
- /bin/bash user-panel/utils/assign-role.bash ${TESTUSER_USERNAME} ${ROLE} backend:5000
- /bin/sh test/create-hydra-client.sh ${KEY} ${SECRET} hydra 4445 http://oauth:5000/callback
- /bin/bash test/create-hydra-client.bash ${KEY} ${SECRET} hydra:4445 http://oauth:5000/callback
- cd test/login_logout/test/behave/
- >
python3 -m behave
......
#!/bin/bash
if [[ $1 == "" ]] || [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then
echo "usage: $0 OAUTH_CLIENT_ID OAUCH_CLIENT_SECRET HOST REDIRECT_URL";
exit 0;
fi
KEY=$1
SECRET=$2
HOST=$3
PORT=$4
REDIRECT_URI=$5
REDIRECT_URI=$4
SCOPES="openid profile email openappstack_roles"
curl --header "Content-Type: application/json" \
--request POST \
--data "{\"client_id\": \"$KEY\", \"client_name\": \"$KEY\", \"client_secret\": \"$SECRET\", \"redirect_uris\": [\"$REDIRECT_URI\"], \"scope\": \"$SCOPES\", \"grant-types\": \"authorization_code,refresh_token\", \"response_types\": [\"code\"], \"token_endpoint_auth_method\": \"client_secret_post\"}" \
http://$HOST:$PORT/clients
http://$HOST/clients
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment