Title: instanceid's Replies | WordPress.org

---

# instanceid

  [  ](https://wordpress.org/support/users/instanceid/)

 *   [Profile](https://wordpress.org/support/users/instanceid/)
 *   [Topics Started](https://wordpress.org/support/users/instanceid/topics/)
 *   [Replies Created](https://wordpress.org/support/users/instanceid/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/instanceid/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/instanceid/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/instanceid/engagements/)
 *   [Favorites](https://wordpress.org/support/users/instanceid/favorites/)

 Search replies:

## Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)

 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Search via api for exact match only?](https://wordpress.org/support/topic/search-via-api-for-exact-match-only/)
 *  Thread Starter [instanceid](https://wordpress.org/support/users/instanceid/)
 * (@instanceid)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/search-via-api-for-exact-match-only/#post-10782224)
 * Closing this.
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Search via api for exact match only?](https://wordpress.org/support/topic/search-via-api-for-exact-match-only/)
 *  Thread Starter [instanceid](https://wordpress.org/support/users/instanceid/)
 * (@instanceid)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/search-via-api-for-exact-match-only/#post-10782221)
 * Hey there,
    I appreciate the reply. I got it worked out already. After a bunch
   of research I was able to make this and it works well.
 *     ```
       add_action( 'rest_api_init', function () {
           register_rest_route( 'endpoint/v1', 'email/(?P<stringvar>[^/]+)', array(
               'methods'             => 'GET',
               'callback'            => 'user_email',
               'permission_callback' => function () {
                   return current_user_can('edit_others_posts');
               },
           ) );
       });
   
       function user_email($data) {
   
           // Get user by their email address
           $user = get_user_by( 'email', $data['stringvar']);
           $userId = $user->ID;
           $user_data = [$userId, $data['stringvar']];
   
           wp_reset_postdata();
   
           return rest_ensure_response($user_data);
       }
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Advanced Access Manager – Access Governance for WordPress] Does anyone have an Nginx config for jwt auth to work? Getting 403 error.](https://wordpress.org/support/topic/does-anyone-have-an-nginx-config-for-jwt-auth-to-work-getting-403-error/)
 *  Thread Starter [instanceid](https://wordpress.org/support/users/instanceid/)
 * (@instanceid)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/does-anyone-have-an-nginx-config-for-jwt-auth-to-work-getting-403-error/#post-10766037)
 * I will note that the Oauth1 is a different plugin than the Oauth2 plugin.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Advanced Access Manager – Access Governance for WordPress] Does anyone have an Nginx config for jwt auth to work? Getting 403 error.](https://wordpress.org/support/topic/does-anyone-have-an-nginx-config-for-jwt-auth-to-work-getting-403-error/)
 *  Thread Starter [instanceid](https://wordpress.org/support/users/instanceid/)
 * (@instanceid)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/does-anyone-have-an-nginx-config-for-jwt-auth-to-work-getting-403-error/#post-10765612)
 * I wanted to test, so I installed an OAuth2 server plugin. Strangely, I am able
   to hit that using Postman and I get a <Response: 200 Ok>. It is hitting /oauth/
   authorize and /oauth/token, but I do have mixed results when trying to do it 
   using Oauth1 and/oauth1/authorize and /oauth1/token from a python application.
   It works when using the ‘Requests’ package, but not when using ‘Rauth’ trying
   to hit the same api urls.
    -  This reply was modified 7 years, 8 months ago by [instanceid](https://wordpress.org/support/users/instanceid/).
    -  This reply was modified 7 years, 8 months ago by [instanceid](https://wordpress.org/support/users/instanceid/).
    -  This reply was modified 7 years, 8 months ago by [instanceid](https://wordpress.org/support/users/instanceid/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Advanced Access Manager – Access Governance for WordPress] Does anyone have an Nginx config for jwt auth to work? Getting 403 error.](https://wordpress.org/support/topic/does-anyone-have-an-nginx-config-for-jwt-auth-to-work-getting-403-error/)
 *  Thread Starter [instanceid](https://wordpress.org/support/users/instanceid/)
 * (@instanceid)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/does-anyone-have-an-nginx-config-for-jwt-auth-to-work-getting-403-error/#post-10760636)
 * Yes sir, I did, I made sure all the other required things I saw in the documentation
   were on as well.
 * It looks like if I turn off the perma links and I make a post request with basic
   auth, the call goes through, but it just shows my main page come up, I don’t 
   see anything about a token or anything like that it looks like it just does nothing.
   I turn perma links back on, it goes dead again on the wp-json/aam/v1/authenticate
   url.
 * I am hosting on Nginx with Virtualmin, the config isn’t anything super crazy,
   the main thing is this part:
 *     ```
       	location ~ \.php$ {
       		try_files $uri =404;
       		fastcgi_pass unix:/var/php-nginx/153843814022189.sock/socket;
       	}
       ```
   
 * Putting the lines in the config that I posed before made the permal links work
   for the rest of the site (without them it didn’t, all pages but the main page
   errored out). The only thing that isn’t working in hitting the API to try and
   post.
 * If I try to go directly to the url, I get this.
 * `{"code":"rest_no_route","message":"No route was found matching the URL and request
   method","data":{"status":404}}`
 * I know for sure the entries are there for the route, as here is a screenshot 
   of them. [https://i.imgur.com/vTyFYfI.png](https://i.imgur.com/vTyFYfI.png)
 * I figured since it said there was no route for method of “data” that it might
   be normal, but I am not sure.
    -  This reply was modified 7 years, 8 months ago by [instanceid](https://wordpress.org/support/users/instanceid/).
    -  This reply was modified 7 years, 8 months ago by [instanceid](https://wordpress.org/support/users/instanceid/).

Viewing 5 replies - 1 through 5 (of 5 total)