Skip to content

Commit 74d4e6d

Browse files
committed
Log OIDC JWT claims to aid SSC debugging of org allowlist
1 parent b233bdb commit 74d4e6d

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

.github/actions/artifactory-oidc/action.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ runs:
4444
echo "::error::Failed to obtain GitHub OIDC token"; exit 1
4545
fi
4646
47+
decode_seg() { local s="${1}"; local m=$(( ${#s} % 4 )); [ $m -ne 0 ] && s="${s}$(printf '=%.0s' $(seq 1 $((4-m))))"; echo "$s" | tr '_-' '/+' | base64 -d 2>/dev/null; }
48+
PAYLOAD=$(decode_seg "$(echo "$OIDC_JWT" | cut -d. -f2)")
49+
echo "OIDC token claims:"
50+
echo " sub = $(echo "$PAYLOAD" | jq -r '.sub')"
51+
echo " aud = $(echo "$PAYLOAD" | jq -r '.aud')"
52+
echo " iss = $(echo "$PAYLOAD" | jq -r '.iss')"
53+
4754
RESP=$(curl -sS "${ARTIFACTORY_URL}/access/api/v1/oidc/token" \
4855
-H 'Content-Type: application/json' \
4956
-d "{\"grant_type\":\"urn:ietf:params:oauth:grant-type:token-exchange\",

0 commit comments

Comments
 (0)