• Resolved instanceid

    (@instanceid)


    Hello,
    I am wondering if anyone happens to know what I might need to change in Nginx to allow this to work? I have tried the following :

    try_files $uri $uri/ /index.php?$query_string;

    It did allow me to use post name urls within wordpress, but for some reason, I still cannot POST to the wp-json/aam/v1/authenticate url and I keep getting 403 errors no matter what I try. I have tested both using NodeJS through PHPStorm as well as Postman. Most other things seem to be working ok. If anyone has any suggestions, I would appreciate it.

    Thanks,

    • This topic was modified 6 years, 4 months ago by instanceid.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author AAM Plugin

    (@vasyltech)

    @instanceid,

    The Jwt authentication feature is dy default disabled. Did you enable it with JWT Authentication option?

    Regards,
    Vasyl

    Thread Starter instanceid

    (@instanceid)

    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

    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 6 years, 4 months ago by instanceid.
    • This reply was modified 6 years, 4 months ago by instanceid.
    Plugin Author AAM Plugin

    (@vasyltech)

    Hm @instanceid,

    It it quite possible that something is not configured properly with Nginx redirect rules. I’m not really familiar with the way it works, however more than happy to learn more about it.

    So in your case I would assume that you are not able to hit any other RESTful endpoints (even those that are unrelated to AAM). Is my assumption correct?

    Regards,
    Vasyl

    Thread Starter instanceid

    (@instanceid)

    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 6 years, 4 months ago by instanceid.
    • This reply was modified 6 years, 4 months ago by instanceid.
    • This reply was modified 6 years, 4 months ago by instanceid.
    Thread Starter instanceid

    (@instanceid)

    I will note that the Oauth1 is a different plugin than the Oauth2 plugin.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Does anyone have an Nginx config for jwt auth to work? Getting 403 error.’ is closed to new replies.