Allow gateways to specify redirect URL

Part of #3396