[ckan-dev] Apache HTTP authentication

David Raznick david.raznick at okfn.org
Thu Dec 12 18:25:16 UTC 2013


Hello

There is a previous email thread on this. It says:

"
I think there is a simple way of fixing this.  The issue is than
mod_wsgi adds REMOTE_USER to the environ and our auth will take that
and try and match it to a user.

https://github.com/okfn/ckanext-geodatagov/blob/master/deployment/etc/ckan/apache.wsgi#L13

Taking lines 13,14,15,17 from the above and putting at the end of your
apache.wsgi file should stop this from happening.  When posting the
CKAN api you will need to use the  X-CKAN-API-Key header or specify
another header in the config file.
"

Thanks

David



On 12 December 2013 17:50, Sajan Ravindran <sajanravindran at gmail.com> wrote:
> Hi,
>
> After installation of CKAN, I have created a user/password at the Apache
> level following the instructions at
> http://httpd.apache.org/docs/2.2/howto/auth.html. I am currently using 2.1
> version of CKAN.
>
> I am running into two problems after this:
> 1. The user, created at Apache level ( described above ) is getting logged
> into CKAN, even though that user was not created in CKAN.
>
> 2. On trying to log out, I am getting a 500 error. The apache log for this
> error states:
>
>  Error - <type 'exceptions.KeyError'>: 'repoze.who.plugins'
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx] URL:
> http://xxxxxxxxx/user/_logout
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx] File
> '/usr/local/lib/python2.7/dist-packages/weberror/errormiddleware.py', line
> 162 in __call__
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx]   app_iter =
> self.application(environ, sr_checker)
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx] File
> '/usr/local/lib/python2.7/dist-packages/webob/dec.py', line 147 in __call__
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx]   resp = self.call_func(req,
> *args, **self.kwargs)
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx] File
> '/usr/local/lib/python2.7/dist-packages/webob/dec.py', line 208 in call_func
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx]   return self.func(req, *args,
> **kwargs)
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx] File
> '/usr/local/lib/python2.7/dist-packages/fanstatic/publisher.py', line 234 in
> __call__
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx]   return
> request.get_response(self.app)
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx] File
> '/usr/local/lib/python2.7/dist-packages/webob/request.py', line 1053 in
> get_response
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx]   application,
> catch_exc_info=False)
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx] File
> '/usr/local/lib/python2.7/dist-packages/webob/request.py', line 1022 in
> call_application
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx]   app_iter =
> application(self.environ, start_response)
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx] File
> '/usr/local/lib/python2.7/dist-packages/webob/dec.py', line 147 in __call__
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx]   resp = self.call_func(req,
> *args, **self.kwargs)
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx] File
> '/usr/local/lib/python2.7/dist-packages/webob/dec.py', line 208 in call_func
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx]   return self.func(req, *args,
> **kwargs)
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx] File
> '/usr/local/lib/python2.7/dist-packages/fanstatic/injector.py', line 54 in
> __call__
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx]   response =
> request.get_response(self.app)
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx] File
> '/usr/local/lib/python2.7/dist-packages/webob/request.py', line 1053 in
> get_response
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx]   application,
> catch_exc_info=False)
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx] File
> '/usr/local/lib/python2.7/dist-packages/webob/request.py', line 1022 in
> call_application
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx]   app_iter =
> application(self.environ, start_response)
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx] File
> '/usr/local/lib/python2.7/dist-packages/beaker/middleware.py', line 73 in
> __call__
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx]   return self.app(environ,
> start_response)
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx] File
> '/usr/local/lib/python2.7/dist-packages/beaker/middleware.py', line 155 in
> __call__
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx]   return self.wrap_app(environ,
> session_start_response)
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx] File
> '/usr/local/lib/python2.7/dist-packages/routes/middleware.py', line 131 in
> __call__
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx]   response = self.app(environ,
> start_response)
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx] File
> '/usr/local/lib/python2.7/dist-packages/pylons/wsgiapp.py', line 125 in
> __call__
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx]   response =
> self.dispatch(controller, environ, start_response)
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx] File
> '/usr/local/lib/python2.7/dist-packages/pylons/wsgiapp.py', line 324 in
> dispatch
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx]   return controller(environ,
> start_response)
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx] File
> '/home/xxxxxx/src/ckan/ckan/lib/base.py', line 325 in __call__
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx]   res =
> WSGIController.__call__(self, environ, start_response)
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx] File
> '/usr/local/lib/python2.7/dist-packages/pylons/controllers/core.py', line
> 221 in __call__
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx]   response =
> self._dispatch_call()
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx] File
> '/usr/local/lib/python2.7/dist-packages/pylons/controllers/core.py', line
> 172 in _dispatch_call
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx]   response =
> self._inspect_call(func)
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx] File
> '/usr/local/lib/python2.7/dist-packages/pylons/controllers/core.py', line
> 107 in _inspect_call
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx]   result =
> self._perform_call(func, args)
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx] File
> '/usr/local/lib/python2.7/dist-packages/pylons/controllers/core.py', line 60
> in _perform_call
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx]   return func(**args)
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx] File
> '/home/xxxxxx/src/ckan/ckan/controllers/user.py', line 366 in logout
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx]   '?came_from=' + url)
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx] File
> '/home/xxxxxx/src/ckan/ckan/controllers/user.py', line 82 in
> _get_repoze_handler
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx]   return
> getattr(request.environ['repoze.who.plugins']['friendlyform'],
> [Thu Dec 12 17:30:06 2013] [error] [xxxxxx] KeyError: 'repoze.who.plugins'
>
>
> Any help or leads would be greatly appreciated.
>
> Regards,
> Sajan
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
>



More information about the ckan-dev mailing list