forked from LinusU/flutter_web_auth
-
Notifications
You must be signed in to change notification settings - Fork 88
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description
Description
When performing a Google OAuth login using flutter_web_auth_2, the flow gets stuck on the Google "Authorized redirect URIs" page for http://localhost:3005
Minimal Reproduction
Steps to reproduce the behaviour:
- Use flutter_web_auth_2: ^5.0.0-alpha.7
- Use the next code
final googleClientId = 'XXXXXXXXXXXX-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com';
final callbackUrlScheme = 'http';
final authUrl = Uri.https('accounts.google.com', '/o/oauth2/v2/auth', {
'response_type': 'code',
'client_id': googleClientId,
'redirect_uri': 'http://localhost:3005/auth-callback',
'scope': 'email',
});
final result = await FlutterWebAuth2.authenticate(
url: authUrl.toString(),
callbackUrlScheme: callbackUrlScheme,
options: FlutterWebAuth2Options(
httpsHost: 'localhost:3005',
httpsPath: '/auth-callback',
),
);- Setup deeplink
<activity
android:name="com.linusu.flutter_web_auth_2.CallbackActivity"
android:exported="true">
<intent-filter android:label="flutter_web_auth_2">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http"
android:host="localhost:3005"
/>
</intent-filter>
</activity>- Login
Exception or Error
No se puede acceder a este sitio
localhost rechazó la conexión.
Intenta:
Comprobar la conexión.
ERR_CONNECTION_REFUSED
Expected Behaviour
Redirection to app.
Screenshots
Additional context
I'm using ngrok to use localhost:3005 in my Android app
Device
Poco X5 Pro 5G
OS
Window 11 23H2
Browser
Chrome
Flutter version
3.35.2
flutter_web_auth_2 version
^5.0.0-alpha.7
Checklist
- I have read and followed the entire troubleshooting guide and it has not provided the solution I need.
- I have provided all the information I can.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working