What's the solution to custom app installation issues on production stores?

I’m facing issue when installing a custom app on a production store. The auth flow uses the ShopifySharp library that allows us to create an auth url
(customerstore).myshopify.com/admin/oauth/authorize?client_id=(custom_app_id)&scope=write_shipping,read_script_tags,read_locations,write_script_tags,read_customers,read_orders,read_products,read_draft_orders,read_checkouts,write_orders,write_customers,read_shipping&redirect_uri=https://(ourapp)/generate-access-token

The auth url contains a return url to our endpoint to https://(ourapp)/generate-access-token

While this works faultless in a development store, it does not seem to work well in production stores.

Shopify does not call show the app installation screen and instead shows this for a Shopify Plus store

For a Shopify Advanced store, weirdly, If I click on the auth url, then the generated link and auth url again, it shows the installation screen. This is not ideal but it works on multiple tries.

Is anyone else facing this issue?

Strangely, the issue is now fixed.

The latest error gave me a hint: “Oauth error invalid_link: This app can’t be installed using this link. Contact the app developer for more information.” which led me to https://stackoverflow.com/questions/55918320/oauth-error-invalid-request-the-redirect-uri-is-not-whitelisted

The Origin was behind CloudFlare SSL but the http:// url was called instead of https:// even though https redirect is enabled on the domain.

Once I disabled CloudFlare for this sub domain, I added LetsEncrypt on the server and it worked as expected.