diff --git a/Proxy/HTTP/FindRolesWithinJWTClaims.bambda b/Proxy/HTTP/FindRolesWithinJWTClaims.bambda deleted file mode 100644 index 4207b2d..0000000 --- a/Proxy/HTTP/FindRolesWithinJWTClaims.bambda +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Find role within JWT claims - * - * @author Trikster - **/ - -if (!requestResponse.hasResponse()) -{ - return false; -} - -var body = requestResponse.response().bodyToString().trim(); - -if (requestResponse.response().hasHeader("authorization")) { - var authValue = requestResponse.response().headerValue("authorization"); - - if (authValue.startsWith("Bearer ey")) { - var tokens = authValue.split("\\."); - - if (tokens.length == 3) { - var decodedClaims = utilities().base64Utils().decode(tokens[1], Base64DecodingOptions.URL).toString(); - - return decodedClaims.toLowerCase().contains("role"); - } - } -} - -return false;