-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Securing Custom Routes #63
Comments
Workaround ==>
|
Hmmm does it work with WPs other default endpoints? this error is thrown by the firebase jwt-php library the plugin uses and I think it could generally backfire due to certificate changes. |
As far as i understand |
Honestly, I never got back around to this the proper way and wrote a "workaround" custom authentication method which essentially just ensures the calls are coming from my app to the WP installation. I need a better solution and will get back around to it when reasonable for business. thanks, |
I have a new custom route which I created via register custom route which I need to secure. If I provide a validate callback which returns true always and forever, the call will succeed without a header sent. If I send an Authorization with valid token, it always fails.
{
"code": "jwt_auth_invalid_token",
"message": "Signature verification failed",
"data": {
"status": 403
}
}
====> here is the register rest route
register_rest_route( 'parent-checklist-rest/v2', '/registration', array( 'methods' => 'GET, POST', 'callback' => __NAMESPACE__.'\\register_user', 'validate_callback'=> __NAMESPACE__.'\\check_JWT', ) );
====> validation callback
`function check_JWT(\WP_REST_Request $request){
//$header = $request->get_header('Authorization');
return TRUE;
//$response = wp_remote_post($header)
}`
Expected Behavior ==>
Actual Behavior ==>
The text was updated successfully, but these errors were encountered: