-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* remove old files * add new files * Update keycloak_setup.sh * Update docker-compose.yml * Update .gitignore * Update example.env * clean up old instructions * update Tyk logout to work with new keycloak
- Loading branch information
Showing
12 changed files
with
87 additions
and
1,366 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# This script creates and configures a client within a Keycloak realm | ||
|
||
echo | ||
echo -e "${BLUE}Creating client: $KEYCLOAK_CLIENT_ID${DEFAULT}" | ||
|
||
CREATE_OUTPUT=$(KCADM create clients -r "$KEYCLOAK_REALM" \ | ||
-s clientId="$KEYCLOAK_CLIENT_ID" \ | ||
-s enabled=true \ | ||
-s protocol=openid-connect \ | ||
-s publicClient=false \ | ||
-s clientAuthenticatorType=client-secret \ | ||
-s standardFlowEnabled=true \ | ||
-s directAccessGrantsEnabled=true \ | ||
-s 'redirectUris=["'"$TYK_LOGIN_TARGET_URL$KEYCLOAK_LOGIN_REDIRECT_PATH"'"]' \ | ||
-s 'webOrigins=["'"$TYK_LOGIN_TARGET_URL"'"]' 2>&1) | ||
# uncomment the line beblow to see the output | ||
# echo $CREATE_OUTPUT | ||
|
||
# Extract the client ID from the output | ||
CLIENT_ID=$(echo $CREATE_OUTPUT | grep -oE '[0-9a-fA-F-]{36}') | ||
|
||
# Create client scopes | ||
SCOPE_NAME="${KEYCLOAK_CLIENT_ID}-audience" | ||
CREATE_OUTPUT=$(KCADM create clients/$CLIENT_ID/protocol-mappers/models -r $KEYCLOAK_REALM \ | ||
-s name=$SCOPE_NAME \ | ||
-s protocol=openid-connect \ | ||
-s protocolMapper=oidc-audience-mapper \ | ||
-s config="{\"included.client.audience\" : \"$KEYCLOAK_CLIENT_ID\",\"id.token.claim\" : \"true\",\"access.token.claim\" : \"true\"}" 2>&1) | ||
# uncomment the line beblow to see the output | ||
# echo $CREATE_OUTPUT | ||
|
||
# EXPORT: Get the client secret and save it to secrets | ||
CLIENT_SECRET=$(KCADM get clients/"$CLIENT_ID"/client-secret -r "$KEYCLOAK_REALM" | jq -r '.value') | ||
echo "$CLIENT_SECRET" > tmp/secrets/keycloak-client-$KEYCLOAK_CLIENT_ID-secret | ||
|
||
# EXPORT: Encode the Keycloak client ID in base64 and save it to secrets | ||
KEYCLOAK_CLIENT_ID_64=$(echo -n "${KEYCLOAK_CLIENT_ID}" | base64) | ||
echo "$KEYCLOAK_CLIENT_ID_64" > "tmp/secrets/keycloak-client-${KEYCLOAK_CLIENT_ID}-id-64" |
25 changes: 0 additions & 25 deletions
25
lib/keycloak/configuration_templates/application-users.properties
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
27 changes: 0 additions & 27 deletions
27
lib/keycloak/configuration_templates/mgmt-users.properties
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.