I have a Expo Web project, which uses Expo AuthSession to facilitate authentication with Azure AD.
This is working locally, via localhost:8081 as expected. I click on a Login button, it opens a Microsoft Login popup where I can log in, and automatically redirects to my main browser where Login was clicked to take me into the website, as a fully authenticated user.
However, when the web app is built and deployed to Apache 2.4, it opens the MS Login popup as expected. However, after login, it redirects back to the main browser, but fails to log in/ redirect me to the main app as an authenticated user.
Below are my Apache 2.4 settings. Please advice how to resolve this (I cannot currently use other Expo Web hosting methods, in case you want to suggest Vercel or other alternatives to Apache 2.4)
/etc/apache2/sites-available/expo.conf
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName myhost.cloud
Alias / /var/www/html/
<Directory /var/www/html/>
Require all granted
</Directory>
</VirtualHost>
.htaccess (/var/www/html/.htaccess)
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.html [QSA,L]