Tmeister / wp-api-jwt-auth

A simple plugin to add JSON Web Token (JWT) Authentication to WP REST API
GNU General Public License v2.0
558 stars 161 forks source link

When switching to RS256 nothing works. #278

Closed UUSR closed 1 year ago

UUSR commented 1 year ago

I switched to RS256 as stated in the description

JWT_AUTH_ALGORITHM

The jwt_auth_algorithm allows you to modify the signing algorithm.

I get errors:

<br />

<b>Warning</b>: openssl_sign(): supplied key param cannot be coerced into a private key in <b>C:\scripts.uusr.tk\wp-content\plugins\jwt-authentication-for-wp-rest-api\includes\vendor\firebase\php-jwt\src\JWT.php</b> on line <b>237</b><br />

<br />

<b>Fatal error</b>: Uncaught DomainException: OpenSSL unable to sign data in C:\OpenServer\domains\scripts.uusr.tk\wp-content\plugins\jwt-authentication-for-wp-rest-api\includes\vendor\firebase\php-jwt\src\JWT.php: 239

Stack trace:

#0 \scripts.uusr.tk\wp-content\plugins\jwt-authentication-for-wp-rest-api\includes\vendor\firebase\php-jwt\src\JWT.php(202): Firebase\JWT\JWT: :sign()

#1 \scripts.uusr.tk\wp-content\plugins\jwt-authentication-for-wp-rest-api\public\class-jwt-auth-public.php(172): Firebase\JWT\JWT: :encode()

#2 \scripts.uusr.tk\wp-includes\rest-api\class-wp-rest-server.php(1181): Jwt_Auth_Public-&gt;generate_token()

#3 \scripts.uusr.tk\wp-includes\rest-api\class-wp-rest-server.php(1028): WP_REST_Server-&gt;respond_to_request()

#4 \scripts.uusr.tk\wp-includes\rest-api\class-wp-rest-server.php(442): WP_REST_Server-&gt;dispatch()

#5 \scripts.uusr.tk\wp-includes\rest-api.php(410): WP_REST_Server-&gt;serve_request( in <b>\scripts.uusr.tk\wp-content\plugins\jwt-authentication-for-wp-rest-api\includes\vendor\firebase\php-jwt\src\JWT.php</b> on line <b>239</b><br />

LadisWasharum commented 1 year ago

Were you able to come up with a solution?

UUSR commented 1 year ago

Unfortunately no.

LadisWasharum commented 1 year ago

Hey @UUSR, I solved this today. If you still want to use this plugin/method, here: https://github.com/Tmeister/wp-api-jwt-auth/issues/280

Tmeister commented 1 year ago

Closing this.