Skip to content

Commit a6a0acc

Browse files
committed
WIP
Signed-off-by: stianst <stianst@gmail.com>
1 parent e3ad29b commit a6a0acc

4 files changed

Lines changed: 8 additions & 7 deletions

File tree

demos/spiffe/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ kct decode $(./fetch-jwt-svid.sh) --jwks=http://localhost:8082/keys
4747

4848
## Configuring Keycloak
4949

50-
You need to first have Keycloak with the experimental External JWT client auth feature enabled (`./kc.sh start-dev --features=client-auth-idp`).
50+
You need to first have Keycloak with the experimental External JWT client auth feature enabled (`./kc.sh start-dev --features=client-auth-federated`).
5151

5252
As of writing this is available in https://github.com/stianst/keycloak/tree/spiffe-jwt-svids-with-idp, but is expected to be available in nightly releases soon and in Keycloak 26.4.0.
5353

@@ -64,9 +64,11 @@ Optionally create a new realm:
6464
"hideOnLogin": true,
6565
"config": {
6666
"validateSignature": "true",
67+
"issuer": "http://localhost:8082",
6768
"jwksUrl": "http://localhost:8082/keys",
6869
"useJwksUrl": "true",
69-
"supportsClientAssertions": "true"
70+
"supportsClientAssertions": "true",
71+
"supportsClientAssertionReuse": "true"
7072
}
7173
}
7274
EOF
@@ -78,7 +80,7 @@ Then create a new client within the realm:
7880
{
7981
"clientId": "spiffe://example.org/myclient",
8082
"serviceAccountsEnabled": true,
81-
"clientAuthenticatorType": "idp-jwt",
83+
"clientAuthenticatorType": "federated-jwt",
8284
"attributes": {
8385
"jwt.credential.issuer": "spiffe"
8486
}

demos/spiffe/client-credential-grant.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ SPIFFE_JWT_SVID=$(./fetch-jwt-svid.sh)
44

55
curl -s -X POST \
66
-d grant_type=client_credentials \
7-
-d client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-spiffe \
8-
-d client-assertion-type=jwt-bearer \
7+
-d client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer \
98
-d client_assertion="$SPIFFE_JWT_SVID" \
109
http://localhost:8080/realms/spiffe/protocol/openid-connect/token

demos/spiffe/spire-server-example.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ server {
22
bind_address = "127.0.0.1"
33
bind_port = "8081"
44
trust_domain = "example.org"
5+
jwt_issuer = "http://localhost:8082"
56
data_dir = "./data/server"
67
log_level = "DEBUG"
78
ca_ttl = "168h"

demos/spiffe/token-introspection.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ ACCESS_TOKEN=$(./client-credential-grant.sh | jq -r .access_token)
55

66
curl -s -X POST \
77
-d token=$ACCESS_TOKEN \
8-
-d client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-spiffe \
9-
-d client-assertion-type=jwt-bearer \
8+
-d client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer \
109
-d client_assertion="$SPIFFE_JWT_SVID" \
1110
http://localhost:8080/realms/spiffe/protocol/openid-connect/token/introspect | jq

0 commit comments

Comments
 (0)