I've followed this manual to set up Twitter auth:

http://wiki.osqa.net/display/docs/Adding+Twitter+Authentication+to+OSQA

And it seems to be working with few glitches though:

1) If I click on "login with Twitter" button, it sends me off to Twitter, where Twitter asks to authorise the application. OK, that's what it supposed to do on the first logon. So I create new user (screen name, email) and successfully log on. Then log out. Then try logging on again. And again I need to "authorise this app" on Twitter. However OSQA is not asking to provide with the screen name/email anymore. Why's that? I suppose OSQA is not storing authorisation token that it receives from Twitter? There's nothing logged in the log file either.

2) For some reason, email field is not populated. It's empty, so it seems that OSQA can't see all the details? BTW, same is with Facebook auth, email is not retrieved and in fact I was also getting:

    EXCEPTION INFO:
            Traceback (most recent call last):
      File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
        response = callback(request, *callback_args, **callback_kwargs)
      File "/var/app/osqa/forum/views/auth.py", line 199, in external_register
        user_data = provider_class.get_user_data(request.COOKIES)
      File "/var/app/osqa/forum_modules/facebookauth/authentication.py", line 69, in get_user_data
        email = smart_unicode(json['email'])
    KeyError: 'email'

When I was registering for the first time with FB. I worker around this by encapsulating this in try: except KeyError:, but I suppose there's something wrong with this?

I am using: Development Build (SVN-1169).

asked 08 Sep '11, 03:33

rytis's gravatar image

rytis
113
accept rate: 0%

edited 08 Sep '11, 07:20

rickross's gravatar image

rickross ♦♦
12.5k2814972

select * from forum_authkeyuserassociation;

reveals that oauth_token and oath_token_secret are stored in the DB. I'll dig around, but still wondering why twitter keeps on asking for authorisation. The app appears as authorised on Twitter page... 8)

(08 Sep '11, 04:17) rytis

@rytis, all meta.osqa.net postings are required to have a clear, specific question in their title field. I have edited this one, but please observe this rule in future. Thanks.

(08 Sep '11, 07:21) rickross ♦♦
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×40
×24

Asked: 08 Sep '11, 03:33

Seen: 339 times

Last updated: 08 Sep '11, 07:21

powered by OSQA