[ckan-dev] Disqus comments plugin SSO enhancement

Koebrick, Andrew (MNIT) andrew.koebrick at state.mn.us
Thu Nov 13 19:02:29 UTC 2014


I am trying to create a fork of the ckanext-disqus extension that makes use of the Single Sign On (SSO) which Disqus offers.  Rather than have users have to sign into the Disqus service, local user data is sent to Disqus.  For more info see: https://help.disqus.com/customer/portal/articles/236206-integrating-single-sign-on

However, I have having a difficult time accessing the ckan user model from the extension.  Could somebody with a better knowledge of CKAN and python give me  a pointer or two?  I seem to be unable to access to context object.  I have been trying things like the below with no luck;

    def disqus_comments(cls):                                                     #Original code
        ''' Adds Disqus Comments to the page.'''                       #Original code
        # we need to create an identifier                                     #Original code
        c = p.toolkit.c                                                                             #Original code

       user_name = c['user']                                                               #My addition ... It fails.
       user_name = context['user']                                                 #Another try. as seen in the extension tutorial... It fails.


I need to access to user's name, email, and Id.

Thanks in advance for any pointers anyone can provide.  If I get SSO hooked up in my fork, I will happily share my code back to the main extension.

Andrew Koebrick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20141113/c93ac2d3/attachment-0002.html>


More information about the ckan-dev mailing list