0maru / twitter_login

MIT License
54 stars 54 forks source link

Stuck on redirected URL after authentication & authorization with Twitter #110

Closed akbulutdora closed 2 years ago

akbulutdora commented 2 years ago

Bug report

Describe the bug After I authenticate and authorize my app to access with Twitter on Android, I go to my callback URL to get the response from my server. The eventStream does not receive any data no matter what I send from my server. I get stuck after being redirected to my callback url with the data printed on the browser.


Additional context

Screenshot of the redirected page, the response body is printed on the top of the screen. image


Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand ``` Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel stable, 3.0.5, on Microsoft Windows [Version 10.0.19044.1889], locale tr-TR) [√] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1) [√] Visual Studio - develop for Windows (Visual Studio Derleme Araçları 2019 16.11.2) [√] Android Studio (version 2021.2) [√] IntelliJ IDEA Ultimate Edition (version 2021.3) [√] VS Code (version 1.70.2) [√] Connected device (2 available) [√] HTTP Host Availability • No issues found! ```

Which method do you use?

0maru commented 2 years ago

Hey @akbulutdora Have you completed setting up your Android intent?

If you have set up the application, run the following command in terminal to see if the application starts up.

adb shell am start -W -a android.intent.action.VIEW -d "INTENT" PACKAGE_NAME

for example

adb shell am start -W -a android.intent.action.VIEW -d "example://twitter" com.maru.twitter_login
akbulutdora commented 2 years ago

Maybe what I understand from the redirect URL is wrong. Should the redirect URL redirect to the app or my backend server (I'm not using firebase, already have a twitter oauth that works on my website)?

About the intent setup that you asked, The application does start up, although I get two choices after running the command. Both of them are redirect to the app, but only one works. Also, it only opens the app, I don't know if anything else is expected.

Starting: Intent { act=android.intent.action.VIEW dat=https://xxxxx/... pkg=com.xxx.xxx_mobile_app }
Status: ok
LaunchState: COLD
Activity: android/com.android.internal.app.ResolverActivity
TotalTime: 1442
WaitTime: 1528
Complete
0maru commented 2 years ago

@akbulutdora

Maybe what I understand from the redirect URL is wrong. Should the redirect URL redirect to the app or my backend server (I'm not using firebase, already have a twitter oauth that works on my website)?

You must redirect to the app. Your app must receive an access token. The app should receive an access token and send it to backend server.

About the intent setup that you asked, The application does start up, although I get two choices after running the command. Both of them are redirect to the app, but only one works. Also, it only opens the app, I don't know if anything else is expected.

This command only starts the app. There is nothing else.

If you have set up Deeplink and it does not work, check to see if the example app works. To make the example app work, replace ApiKey and ApiSecretKey with your own keys and register example:// as a callback URLs in the Twitter Developer Portal.

akbulutdora commented 2 years ago

After redirecting to the app, there was no problem. Sorry that I missed the initial notification for your answer.