I had the same issue with deploying the app on an Apache HTTP server in a subfolder named ‘testLogin’. The root web page is our corporate page. Auth0 kept trying to use the root address but that was not listed in the Allowed Callbacks URLs in the Auth0 Application. In order to fix this I had to modify the authorizationParams in the index.js file:
authorizationParams: {
redirect_uri: window.location.origin + '/testLogin',
...(config.audience ? { audience: config.audience } : null),
},
Note that I modified the “redirect_uri: window.location.origin,” line to “redirect_uri: window.location.origin + ‘/testLogin’,” This allowed the login to work and redirect to the specifice subfolder.
Note also that I have the homepage property set in the package.json file set with
"homepage": "https://{my domain}/testLogin",
I also have an .htaccess file in the public folder as well with a RedirectMatch set to the full URL to the subfolder:
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.html [QSA,L]
RedirectMatch ^/$ "https://{my domain}/testLogin/"
With the above done, I can successfully login on the subfolder application and get returned to that subfolder application.
I am now experiencing a similar difficulty on Logout. If I set the Allowed Logout URLs to the path of the subfolder (`https://{my domain}/testLogin’) I get the Callback URL mismatch error. If I change that to ‘https://{my domain}’ it works but is redirected to the root web page and not that of the subfolder application. Reading the documents I try including the returnTo option (https://{my domain}/testLogin, https://{my domain}?returnTo=https://{my domain}/testLogin&client_id={CLIENT_ID}) but this does exactly the same thing by returning to the root web page.
Perhaps you can help me resolve the logout issue that it should return to the subfolder application and not the root application?