Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Android ERR_CONNECTION_REFUSED when redirecting from external url back to https://localhost #7367

Open
1 of 3 tasks
atremel opened this issue Mar 25, 2024 · 1 comment
Labels

Comments

@atremel
Copy link

atremel commented Mar 25, 2024

Capacitor Version

Latest Dependencies:

@capacitor/cli: 5.7.4
@capacitor/core: 5.7.4
@capacitor/android: 5.7.4
@capacitor/ios: 5.7.4

Installed Dependencies:

@capacitor/cli: 5.7.3
@capacitor/core: 5.7.3
@capacitor/android: 5.7.3
@capacitor/ios: 5.7.3

[success] Android looking great! 👌

Other API Details

npm --version -> 10.2.1
node --version -> v18.18.0

Platforms Affected

  • iOS
  • Android
  • Web

Current Behavior

The app is redirecting to an external auth service. From there the user is redirected 302 back to https://localhost, where the browser blocks the request saying ERR_CONNECTION_REFUSED:

image

HTTPS is encouraged: "we would strongly recommend that you change your androidScheme to use https."

capacitor.config.ts looks like this:

import { CapacitorConfig } from '@capacitor/cli';

const config: CapacitorConfig = {
  appId: 'com.somedomain.app',
  appName: 'App',
  webDir: 'dist/prod',
  server: {
    androidScheme: 'https',
    allowNavigation: [
      "login.somedomain.com"
    ]
  },
  plugins: {
    CapacitorHttp: {
      enabled: true,
    },
  },
};

export default config;

Expected Behavior

Redirect to https://localhost is successful.

Project Reproduction

https://github.com/atremel/redir

Additional Information

Real device has this issue, too.

@atremel atremel added the triage label Mar 25, 2024
@atremel
Copy link
Author

atremel commented Apr 19, 2024

Just posting an update - Ionic 6 now requires https by default:

image

Any updates on this issue? It really blocks us from migrating our native apps to Ionic / Capacitor...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant