Title: Error jwt_auth_bad_iss only with Https
Last modified: November 29, 2019

---

# Error jwt_auth_bad_iss only with Https

 *  Resolved [IoClaudio](https://wordpress.org/support/users/ioclaudio/)
 * (@ioclaudio)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/error-jwt_auth_bad_iss-only-with-https/)
 * Hi,
    I’m having some problems using the header authentication.
 * If I get a JWT token in this way:
    `https://mysite/wp-json/jwt-auth/v1/token`
 * I get the token: <my_jwt_token>
 * If I add this header calling a custom web service:
    `Authorization: Bearer <my_jwt_token
   >`
 * The web service is defined in this way:
 *     ```
       register_rest_route('em/v1', 'useredit', [
       	'methods' => 'PUT',
       	'callback' => 'wp_kns_useredit',
       	'permission_callback' => function($request){
       	  return is_user_logged_in();
       	}
       ]);
       ```
   
 * If I use Http, it works:
    [http://mysite/wp-json/em/v1/useredit](http://mysite/wp-json/em/v1/useredit)
 * But if I use Https, I have this error:
    [https://mysite/wp-json/em/v1/useredit](https://mysite/wp-json/em/v1/useredit)
 *     ```
       {
       "code": "jwt_auth_bad_iss",
       "message": "The iss do not match with this server",
       "data": {
       "status": 403
       }
       }
       ```
   
 * Which could be the problem?
    I’m using WordPress 5.3.
    -  This topic was modified 6 years, 6 months ago by [IoClaudio](https://wordpress.org/support/users/ioclaudio/).

Viewing 1 replies (of 1 total)

 *  Thread Starter [IoClaudio](https://wordpress.org/support/users/ioclaudio/)
 * (@ioclaudio)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/error-jwt_auth_bad_iss-only-with-https/#post-12196792)
 * I’ve solved.
    The problem was that I was calling: `http://mysite/wp-json/jwt-
   auth/v1/token`
 * with HTTP
    and I was calling: [https://mysite/wp-json/em/v1/useredit](https://mysite/wp-json/em/v1/useredit)
   with HTTPS. I call both with HTTP or both with HTTPS it works.
 * cld

Viewing 1 replies (of 1 total)

The topic ‘Error jwt_auth_bad_iss only with Https’ is closed to new replies.

 * ![](https://ps.w.org/jwt-authentication-for-wp-rest-api/assets/icon-256x256.jpg?
   rev=3372068)
 * [JWT Authentication for WP REST API](https://wordpress.org/plugins/jwt-authentication-for-wp-rest-api/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/jwt-authentication-for-wp-rest-api/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/jwt-authentication-for-wp-rest-api/)
 * [Active Topics](https://wordpress.org/support/plugin/jwt-authentication-for-wp-rest-api/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/jwt-authentication-for-wp-rest-api/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/jwt-authentication-for-wp-rest-api/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [IoClaudio](https://wordpress.org/support/users/ioclaudio/)
 * Last activity: [6 years, 6 months ago](https://wordpress.org/support/topic/error-jwt_auth_bad_iss-only-with-https/#post-12196792)
 * Status: resolved