I would like to make an provided-hosted app for on premise server. I publish this type of application on azure cloud and I've tried to open it in SharePoint on-Premise server and in SharePoint Online. SharePoint Online open this app correctly. Unfortunately SharePoint on-Premise return "401 UNAUTHORIZED" error when it try to connect to azure website. I know that this error is returned, when SharePoint is try to open a website which has "SharePointContextFilter" attribute in controller (It is a MVC SharePoint application). Do you know, how can I open this app on on-premise SharePoint?
You need configure low trust authentication model for on-premise environment.
jansenbe had shared the sample script in github below.