Hi.
Does "ERP Web App" support external IdP (SAML or OAuth)?
If it is supported, I think that protection itself is possible by using Azure AD, which is the authentication platform of Office 365, as an IdP. It should work regardless of which environment it is running in.
However, I couldn't understand what the "URL in offcie365 custom app" meant. Can you give me some additional information for me to understand?