Registration of API Client giving 404 error

I am using a public machine (ubuntu) and installed openemr there, the setup is done and the configuration through admin->globals->connectors is done. I am trying to register a client by hitting a post request to: http://public_ip/openemr/oauth2/default/registration
but it is giving a 404 error. I checked there is the oauth2 folder under openemr folder and .htaccess is also present.
I am able to go through the interface via this IP but the registration gives me this error