Unable to Register Client App

Situation
Getting a 404 error for POST route /oauth2/default/registration while registering a new Client app

OpenEMR Version
7.0.0

PHP version
8.1

Browser:
Firefox 112.0.1

Operating System
Ubuntu 22.04

Response

body: ReadableStream { locked: true }
bodyUsed: true
headers: Headers(6) { connection → "Keep-Alive", "content-length" → "273", "content-type" → "text/html; charset=iso-8859-1", … }
ok: false
redirected: false
status: 404
statusText: "Not Found"
type: "basic"
url: "https://localhost:9300/oauth2/default/registration"

Error

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data register-app.php:102:29
    registerApp https://localhost:9300/interface/smart/register-app.php:102

Global Settings

Site Address Override: https://localhost:9300
Enable OpenEMR Standard FHIR REST API: enabled
Enable OpenEMR Standard REST API: enabled

App Registration

Confidential
Multipurpose app

RedirectURI: https://localhost:9300/swagger/oauth2-redirect.html
LaunchURI: https://localhost:9300/swagger/index.html
scopes: enabled all except system scopes

Are your apache mod_rewrite enabled? It looks like you are getting a 404 not found and that suggests that mod_rewrite is not working for you.
If you go to the following URL in your browser: https://localhost:9300/oauth2/default/registration

You should see the following for the GET request:

{"error":"invalid_client_metadata","error_description":"Unexpected content type","message":"Unexpected content type"}

If you get a 404, it means your .htaccess file is not being applied

oh yes! Thanks.
I had to enable mod_rewrite and had to AllowOverride All in the apache conf file.
Works now!