Robert, we have to host the app on our server because we want to call it from another app using a more user friendy URL. I thought that using the Web AppBuilder embedded in Portal was the normal workflow, but I understand that having to do with minified code is a pain.
I will follow your suggestion and restart from the scratches with Web AppBuilder for developer.
Is your web map and data that the app is using shared publicly?
No, all of our data is hosted in ArcGIS server using secured services.
When a user tries to view our app, he is redirected to the Portal standard login page, with all the links (home, gallery, map, scene, group) in the high part of the page and the OAuth form in the middle. I would like to show him only the OAuth form, so that he doesn't get confused.