-
Notifications
You must be signed in to change notification settings - Fork 246
Allow non-Zulip.com installs to login via Google Auth #70
Conversation
Automated message from Dropbox CLA bot @kunall17, it looks like you've already signed the Dropbox CLA. Thanks! |
7d659db
to
c20dafe
Compare
@@ -5,7 +5,7 @@ android { | |||
buildToolsVersion "23.0.2" | |||
defaultConfig { | |||
applicationId "com.zulip.android" | |||
minSdkVersion 13 | |||
minSdkVersion 16 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a change that potentially has a pretty big impact on the Zulip install base. What's the reason for upping this to 16?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I added AppAuth dependency I got this error!
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 13 cannot be smaller than version 16 declared in library [net.openid:appauth:0.2.0]
Suggestion: use tools:overrideLibrary="net.openid.appauth" to force usage
AppAuth asks for 16, so I bumped it up. Didn't wanted to force usage.!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool. For now, let's assume it's ok :)
This looks really good overall @kunall17!! great job!! A few things: = If you go to "Login with Google" and then click the X button to go back to the login screen, the spinner is still showing. |
c20dafe
to
df38b32
Compare
@niftynei Updated the Code! :) |
Cool, thanks Kunal. I'm having some trouble getting the login to complete correctly. I've got the Oauth Keys set up and can successfully complete the Oauth portion but when it navigates back to the app it seems to both log me out and successfully complete. As a result, I end up on a new LogInActivity (hitting the back button takes me to the first LogInActivity), but I can't successfully get to the messages view. I can see the app making all the right API calls to my dev server, but also making a call to log me out. Do you also have this behavior? There's also these errors in the logs:
|
If I use my keys for the Web client I too receive the same error!
|
@niftynei for the If you go to "Login with Google" and then click the X button to go back to the login screen, the spinner is still showing. To set a CustomTabsCallback (callback which gets the events in chrome custom tabs) is currently not available in the 0.2.0 version of openId AppAuth library, I have made changes in the library for this callback and posted a PR in their repository but I'm not sure when this will be merged and a new version of the library will be released , they had talks about new version coming up soon last month. Will it be right to include their library as a module and compile with the fix in our gradle? |
df38b32
to
ce9b571
Compare
@niftynei updated the branch! :) |
@kunall17 were you able to successfully use this to log in to a server other than your dev server? I believe http://zulip.tabbott.net is set up to do this now. |
ce9b571
to
43f0bb3
Compare
@kunall17 I haven't been able to get this branch to build. I'm getting |
43f0bb3
to
6e4ed65
Compare
Damn, sorry the silly rebase conflicts. |
Yeah, that's a good idea. @timabbott sent me one a few weeks ago, I'll look into setting it up. |
6e4ed65
to
7afcf6d
Compare
@kunall17 I can't for the life of me get this working. I'm sending you an email to get some help debugging my setup. :( |
@kunall17 if you could add the docs for how to set up a web server to use this that you're writing up to this PR, I'll go ahead and get it merged in. We can retro-actively fix any other errors that come up. |
@niftynei I was just waiting for zulip.tabbott.net to get this thing working then I would go edit the docs! |
this has been fixed by using the same GOOGLE_CLIENT_ID for all installs. |
Fixed #64 ! :)
Used Open-ID Auth library to create the Auth System!
Requires two Client ID's in the settings.py here
'GOOGLE_CLIENT_ID'
and'GOOGLE_OAUTH2_CLIENT_ID'
and ofcourseGoogleMobileOauth2Backend
to be enabled in the Authentication Backends!Demo: