Git Product home page Git Product logo

Comments (13)

timabbott avatar timabbott commented on May 22, 2024

Does GoogleMobileOauth2Backend in the same file work for you?

I'd expect it to get further and then complain until you give it google oauth tokens in the settings.py files; you can see the public keys in zproject/local_settings.py, search for GOOGLE (and you'll need to add the private keys in /etc/zulip/zulip-secrets.conf).

Let me know if this works and I can fix the docs...

from zulip.

yuvipanda avatar yuvipanda commented on May 22, 2024

Yup, that backend works. Am at AttributeError: 'Settings' object has no
attribute 'GOOGLE_OAUTH2_CLIENT_ID'
now.

However, if I go to 'register' it still asks me for email too

On Fri, Sep 25, 2015 at 6:45 PM, Tim Abbott [email protected]
wrote:

Does GoogleMobileOauth2Backend in the same file work for you?

I'd expect it to get further and then complain until you give it google
oauth tokens in the settings.py files; you can see the public keys in
zproject/local_settings.py, search for GOOGLE (and you'll need to add the
private keys in /etc/zulip/zulip-secrets.conf).

Let me know if this works and I can fix the docs...


Reply to this email directly or view it on GitHub
#10 (comment).

Yuvi Panda T
http://yuvi.in/blog

from zulip.

yuvipanda avatar yuvipanda commented on May 22, 2024

What should be the redirect URL for getting credentials?

from zulip.

timabbott avatar timabbott commented on May 22, 2024

Whether there's a password prompt on the login page should be determined by zproject/backend.py's password_auth_enabled() so the issue is likely there; if the realm you're using is called "zulip.com" then I bet the settings.PRODUCTION there should be a settings.ZULIP_COM instead.

In the same file there's some links to docs on Google's oauth stuff in the doc strings for GoogleMobileOauth2Backend:
https://developers.google.com/+/mobile/android/sign-in#server-side_access_for_your_app
https://developers.google.com/accounts/docs/CrossClientAuth#offlineAccess

from zulip.

yuvipanda avatar yuvipanda commented on May 22, 2024

Apparently https://zulip.wmflabs.org/accounts/login/google/done/ is the redirect URL.

from zulip.

yuvipanda avatar yuvipanda commented on May 22, 2024

Now I'm at:

2015-09-25 21:59:29,446 ERROR    Internal Server Error: /accounts/login/google/done/
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 132, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/zulip/deployments/2015-09-26-01-18-40/zerver/views/__init__.py", line 695, in finish_google_oauth2
raise Exception('Could not convert google pauth2 code to access_token\r%r' % resp.text)
Exception: Could not convert google pauth2 code to access_token^Mu'{\n "error": "invalid_request",\n "error_description": "client_secret is missing."\n}\n'

from zulip.

timabbott avatar timabbott commented on May 22, 2024

In zproject/settings.py it has:

GOOGLE_OAUTH2_CLIENT_SECRET = get_secret('google_oauth2_client_secret')

So you need to put your oauth secret in /etc/zulip/secrets.conf with that
as the secret name.

    -Tim Abbott

On Fri, Sep 25, 2015 at 7:01 PM, Yuvi Panda [email protected]
wrote:

Now I'm at:

2015-09-25 21:59:29,446 ERROR Internal Server Error: /accounts/login/google/done/
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 132, in get_response
response = wrapped_callback(request, _callback_args, *_callback_kwargs)
File "/home/zulip/deployments/2015-09-26-01-18-40/zerver/views/init.py", line 695, in finish_google_oauth2
raise Exception('Could not convert google pauth2 code to access_token\r%r' % resp.text)
Exception: Could not convert google pauth2 code to access_token^Mu'{\n "error": "invalid_request",\n "error_description": "client_secret is missing."\n}\n'


Reply to this email directly or view it on GitHub
#10 (comment).

from zulip.

yuvipanda avatar yuvipanda commented on May 22, 2024

Now at:

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 132, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/zulip/deployments/2015-09-26-01-18-40/zerver/views/__init__.py", line 696, in finish_google_oauth2
access_token = resp.json['access_token']
TypeError: 'instancemethod' object has no attribute '__getitem__'

from zulip.

yuvipanda avatar yuvipanda commented on May 22, 2024

Found at least a couple places where resp.json is used instead of resp.json(). Live hacking those fixed the issue.

from zulip.

timabbott avatar timabbott commented on May 22, 2024

OK awesome! it'd be great if you could post the changes you needed, even
if in not-merge-ready form, so we can fix this for the next group of people
who try to set this up :)

    -Tim Abbott

On Fri, Sep 25, 2015 at 7:30 PM, Yuvi Panda [email protected]
wrote:

Found at least a couple places where resp.json is used instead of
resp.json(). Live hacking those fixed the issue.


Reply to this email directly or view it on GitHub
#10 (comment).

from zulip.

yuvipanda avatar yuvipanda commented on May 22, 2024

Sure! #14 is the PR :)

from zulip.

timabbott avatar timabbott commented on May 22, 2024

OK I think I fixed this and also I attempted to document how to set this up in 5dd330e
I'd appreciate it if you could check that over for any mistakes, and maybe expand the steps for setting it up with Google if you think it's appropriate.

from zulip.

timabbott avatar timabbott commented on May 22, 2024

Closing this issue since I think this is now resolved in the current documentation.

from zulip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.