From 41bd86705f1c520bef4a80965e6ef512c72d811d Mon Sep 17 00:00:00 2001 From: Michael Corkum Date: Mon, 2 Mar 2020 13:01:13 -0500 Subject: [PATCH 1/3] Removing ISS check --- public/class-jwt-auth-public.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/public/class-jwt-auth-public.php b/public/class-jwt-auth-public.php index bcfe2e1..349171b 100755 --- a/public/class-jwt-auth-public.php +++ b/public/class-jwt-auth-public.php @@ -274,16 +274,17 @@ public function validate_token($output = true) try { $token = JWT::decode($token, $secret_key, array('HS256')); /** The Token is decoded now validate the iss */ - if ($token->iss != get_bloginfo('url')) { - /** The iss do not match, return error */ - return new WP_Error( - 'jwt_auth_bad_iss', - 'The iss do not match with this server', - array( - 'status' => 403, - ) - ); - } + // if ($token->iss != get_bloginfo('url')) { + // /** The iss do not match, return error */ + // return new WP_Error( + // 'jwt_auth_bad_iss', + // 'The iss do not match with this server', + // array( + // 'status' => 403, + // ) + // ); + // } + /** So far so good, validate the user id in the token */ if (!isset($token->data->user->id)) { /** No user id in the token, abort!! */ From dd0bce64efcbe82c6a331341d800458d487c2dcd Mon Sep 17 00:00:00 2001 From: Troy Chaplin Date: Tue, 3 Mar 2020 07:59:20 -0500 Subject: [PATCH 2/3] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index ff86bc6..97484c7 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "tmeister/wp-api-jwt-auth", + "name": "cuweb/wp-api-jwt-auth", "description": "A simple plugin to add JSON Web Token (JWT) Authentication to WP REST API.", "homepage": "https://github.com/Tmeister/wp-api-jwt-auth/", "type": "wordpress-plugin", From e0bdece1017d97dc18d3847b17363397d81cdf76 Mon Sep 17 00:00:00 2001 From: Michael Ieradi Date: Wed, 11 Mar 2020 13:37:54 -0400 Subject: [PATCH 3/3] WSCUP-66: remove commented code fro JWT plugin --- public/class-jwt-auth-public.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/public/class-jwt-auth-public.php b/public/class-jwt-auth-public.php index 349171b..eb64c58 100755 --- a/public/class-jwt-auth-public.php +++ b/public/class-jwt-auth-public.php @@ -274,16 +274,16 @@ public function validate_token($output = true) try { $token = JWT::decode($token, $secret_key, array('HS256')); /** The Token is decoded now validate the iss */ - // if ($token->iss != get_bloginfo('url')) { - // /** The iss do not match, return error */ - // return new WP_Error( - // 'jwt_auth_bad_iss', - // 'The iss do not match with this server', - // array( - // 'status' => 403, - // ) - // ); - // } + if ($token->iss != get_bloginfo('url')) { + /** The iss do not match, return error */ + return new WP_Error( + 'jwt_auth_bad_iss', + 'The iss do not match with this server', + array( + 'status' => 403, + ) + ); + } /** So far so good, validate the user id in the token */ if (!isset($token->data->user->id)) {