From bcb291774e3fd3958ec07cc5d4c82a1ed5f06978 Mon Sep 17 00:00:00 2001 From: Miguel Grinberg Date: Tue, 15 Sep 2015 18:32:08 -0700 Subject: [PATCH] Support base64 padding in federated tokens Fernet tokens can have base64 padding, which gets urlencoded as one or more "%3D" strings at the end of the token. This change expands the parsing of tokens to support the % character. Change-Id: I62ff7bd94b475cddbc3cfcc7782ce4ef3b65b268 --- scripts/federated-login.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/federated-login.sh b/scripts/federated-login.sh index 1341010d73..5241157d68 100755 --- a/scripts/federated-login.sh +++ b/scripts/federated-login.sh @@ -72,7 +72,7 @@ if [ "$?" != "0" ]; then echo "Could not obtain IdP token, did you forget to import your openrc file? See token.json and error.log for details." exit 1 fi -IDP_TOKEN=`grep X-Subject-Token token.txt | grep -Po ': .*' | grep -Po '[a-zA-Z0-9-_]*'` +IDP_TOKEN=`grep X-Subject-Token token.txt | grep -Po ': .*' | grep -Po '[a-zA-Z0-9-_%]*'` echo - Obtained IdP token. # obtain the service provider URLs @@ -106,7 +106,7 @@ if [ "$?" != "0" ] || ! grep -q X-Subject-Token unscoped.txt; then echo Could not obtain unscoped token from service provider. See unscoped.txt and error.log for details. exit 1 fi -UNSCOPED_TOKEN=`grep X-Subject-Token unscoped.txt | grep -Po ': .*' | grep -Po '[a-zA-Z0-9-_]*'` +UNSCOPED_TOKEN=`grep X-Subject-Token unscoped.txt | grep -Po ': .*' | grep -Po '[a-zA-Z0-9-_%]*'` echo - Obtained unscoped token from SP: $UNSCOPED_TOKEN echo '- Domains available at sp: '