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

Github's Authorize Button Disabled in Android WebView #674

Closed
pallavbakshi opened this issue Dec 20, 2017 · 29 comments
Closed

Github's Authorize Button Disabled in Android WebView #674

pallavbakshi opened this issue Dec 20, 2017 · 29 comments

Comments

@pallavbakshi
Copy link

pallavbakshi commented Dec 20, 2017

Question Response
Version? v1.4.1
Devices tested? Xiaomi Mi 4 - Android 5.0

What Currently Happens?

Upon logging in, the inbuilt browser showcases a Github auth page with the green button (Authorize) disabled.

This problem is encountered only when the sign-in flow is interrupted due to some user circumstances. For example, if you download the app for the first time and click sign-in, it will take you to the Github Auth page where you can enter your details to allow git-point to access your profile/repo. Once you successfully sign in, Github asks you to allow the app the required permissions. At this point, the green button is working (if this is a fresh sign-in attempt) and the cancel button is disabled so the user cannot break the flow. However, due to external circumstances, like a phone call or if the user closes the app or anything else, the sign-in process in broken in between. User has already signed in to the Github web page but hasn't authorized the GitPoint app yet. Now when the user reopens the app and tries to sign in, he is directly taken to the authorization page (permission page where he left last time). He is asked to allow the app to access its profile, etc. And at this time the green button (authorize button) is disabled. It shall be noted that scrolling and normal tapping is still enabled. ONLY the authorize button is disabled.

What Do You Expect To Happen?

Green button to be enabled.

My Reproduction Steps

Mentioned above.

  1. Try sign-in for the first time
  2. Enter credentials. Don't approve the app though.
  3. Close the app (don't authorize the app yet)
  4. Reopen the app and try to sign-in

My personal view of what is happening -
Since the android WebView saves the cache/cookies therefore the app picks up from the last point where the user left the signin process on the github page (that is why user doesn't need to sign in). However, the javascript seems to be disabled which disables the green button. I have only checked it in Android.

@machour
Copy link
Member

machour commented Jan 16, 2018

I think this is the same as #680 and is addressed by #681
Leaving this open for the wonderful details, thank you @pallavbakshi !

@machour machour added the has pr label Jan 16, 2018
@pallavbakshi
Copy link
Author

Ha ha! I came first though (Mine issue is 674). Fun aside, I will test it and close the issue if it is fixed. However, it will take me some time to test it. Thanks :D

@machour
Copy link
Member

machour commented Jan 16, 2018

hahahaha, you just reminded me when I told my grandpa older brother: "oh you look like grandpa" and he shouted at me "no, HE looks like ME" 🤣

I think @housseindjirdeh will be providing a test APK shortly for #680, I'll make sure to notify you so that you can test as well. Thank you soo much!

@housseindjirdeh
Copy link
Member

@pallavbakshi here's the APK with the fix: https://github.com/gitpoint/git-point/releases/tag/hotfix

Please take as long as you need to give it a shot, there's definitely no rush :)

@pallavbakshi
Copy link
Author

@housseindjirdeh Thanks! I will check it soon, hopefully.

@ShalokShalom
Copy link

This is still the case for me, while I use the default browser in BlackBerry OS 10.

@machour
Copy link
Member

machour commented Feb 13, 2018

Thank you for the feedback. We need to get rid of that WebView and use something like react-native-oauth..

@ShalokShalom
Copy link

Thanks a lot :D

I can open another issue, for the integration of react-native-oauth or the evaluation of alternatives?

What is most easy to integrate?

Fast Hub uses Tokens too:
https://github.com/k0shk0sh/FastHub#features

@machour
Copy link
Member

machour commented Feb 13, 2018

Please do! If you want to give it a shot, we'll gladly accept a PR too 😅

@machour machour added this to Todo in 1.6.0 Feb 16, 2018
@ShalokShalom
Copy link

Ok, same news: Its in the auth app itself.

This issue happens to me on all different implementations.
And the auth on pages who offer both, Twitter and Github works for Twitter and not for Github.

@machour
Copy link
Member

machour commented Mar 22, 2018

@pallavbakshi could you remove the app and install https://idk.tn/gitpoint-test.apk ?

After clicking "Sign in" you should see a really ugly "Can't sign in?" button that will open the GitHub oAuth URL in your browser. Tell me if that works for you 🙏

@pallavbakshi
Copy link
Author

Hey hey!! @machour ... Sure I'll do so over this weekend. Thanks for your patience and hard work.

@chinesedfan chinesedfan moved this from Todo to In Progress in 1.6.0 Mar 23, 2018
@Mouvedia
Copy link

Mouvedia commented Mar 26, 2018

It's immediately disabled on iOS 9: it's unusable.

@machour
Copy link
Member

machour commented Mar 26, 2018

Hi @Mouvedia, this issue happens only on Android to my knowledge. Can you provide us with some more information about your device?

@Mouvedia
Copy link

@machour iOS 9.3.5 iPhone 4S

@machour
Copy link
Member

machour commented Mar 27, 2018

@Mouvedia If the button is not clickable, it means that GitHub doesn't support your browser (we're using a WebView). But this seems odd.

Are you able to click the button on this link using Safari (Private Navigation): https://github.com/login/oauth/authorize?response_type=token&client_id=87c7f05700c052937cfb&redirect_uri=gitpoint://welcome&scope=user%20repo&state=foobar

@Mouvedia
Copy link

@machour I cannot on my iPhone.

@machour
Copy link
Member

machour commented Mar 27, 2018

Can you provide a screenshot?

@Mouvedia
Copy link

Mouvedia commented Mar 27, 2018

If you don't believe me that's fine by me.

@machour
Copy link
Member

machour commented Mar 27, 2018

Wow wow wow, you totally misunderstood my request pal :)

I asked if you were able to click the button directly in Safari, because Safari is used in our application in a webview, and I wanted to verify if our integration was faulty or not.

You said that you were unable to.

I asked for a screenshot of the page on Safari to see if I could spot any error that would help me understand the problem, and not in any way because I didn't believe you. Now can I have this screenshot or not ? :)

By the way, the URL I provided is using our dev client_id and may brake at any time.

@Mouvedia
Copy link

Mouvedia commented Mar 27, 2018

There's nothing to see, just a disabled button. It's probably the same problem: you gotta enable javascript explicitly.

@machour
Copy link
Member

machour commented Mar 27, 2018

Should be enabled in Safari..

@Mouvedia
Copy link

Mouvedia commented Mar 27, 2018

Please note that GitHub no longer supports old versions of Safari.

Indeed. Well in the meantime could you share the prod url as a workaround ?

@machour
Copy link
Member

machour commented Mar 27, 2018

I don't understand how you're gonna use it as you're reporting it doesn't work in Safari, but there you go: https://github.com/login/oauth/authorize?response_type=token&client_id=5f4e87fae2ea9d3d27c4&redirect_uri=gitpoint://welcome&scope=user%20repo&state=foobar

@Mouvedia
Copy link

Mouvedia commented Mar 27, 2018

Well actually I managed to do it, here's the workaround:

  1. authorize yourself using the link in this comment
  2. click on this link this time from within safari on your iPhone and get redirected to the installed app
  3. end up on a frozen welcome page
  4. close the app
  5. reopen

@machour
Copy link
Member

machour commented Mar 31, 2018

@pallavbakshi sorry to bug you, but could you possibly confirm that https://idk.tn/gitpoint-test.apk works for you?

I'd love to ship the fix in a release soon 😄

@pallavbakshi
Copy link
Author

Fixed.

@machour
Copy link
Member

machour commented Apr 3, 2018

Thank you so much @pallavbakshi 🎉 🎉

@machour machour closed this as completed Apr 3, 2018
@machour machour moved this from In Progress to Done in 1.6.0 Apr 3, 2018
@SenzoNgele
Copy link

Lool after I struggled for years.. I have found a Solution to This
The course is. First I use my google chrome which I saved my Github account with.
So my VS was taking me to Microsoft Edge and get the button disabled.

All you have to do is to change you Default browser on your machine to the one u have signed is with on github

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
1.6.0
Done
Development

No branches or pull requests

7 participants