From 66a86dfe1abd1039cdb034a6bf437135bd08826d Mon Sep 17 00:00:00 2001 From: "m.lettere" Date: Wed, 25 Aug 2021 17:02:14 +0200 Subject: [PATCH] retry basic auth also when IAM returns 400 --- roles/pep/templates/pep.js.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/pep/templates/pep.js.j2 b/roles/pep/templates/pep.js.j2 index ea88c06..60765db 100644 --- a/roles/pep/templates/pep.js.j2 +++ b/roles/pep/templates/pep.js.j2 @@ -158,7 +158,7 @@ function requestToken(context){ context.authn.verified_token = JSON.parse(Buffer.from(context.authn.token.split('.')[1], 'base64url').toString()) return context - } else if (reply.status === 401){ + } else if (reply.status === 400 || reply.status === 401){ var options = { "body" : "grant_type=password&username="+context.authn.user+"&password="+context.authn.password }