mobyle2 / mobyle2.web

2 stars 0 forks source link

problem using openid behind proxy #2

Open osallou opened 11 years ago

osallou commented 11 years ago

When behind a web proxy, there is an issue with openid. After authentication on remote provider, user is redirected back to the site on a wrong address, the one given in [server:main] for host and port.

It does not seem to take into account the value defined in init.py:

config.add_openid_login(realm='....

osallou commented 11 years ago

Ok, independently from realm setup from config, it seems it was related to a proxy configuration in Apache (missing ProxyPreserveHost On).

Seems to "work" now. though, on page return it fails:

after openid provider url is back to:

http://mobyletest.genouest.org/login/openid/callback?janrain_nonce=2012-12-11T12%3A20%3A30ZDB7OMm

and it ends with an 500 internal error

asaladin commented 11 years ago

The return url looks fine. You should have more details for the internal error on the console logs

osallou commented 11 years ago

Here are the logs


Generated checkid_setup request to http://www.myopenid.com/server with assocication XXXXXXXXX
2012-12-11 13:32:04 [12708] [ERROR] Error handling request
Traceback (most recent call last):
  File "/root/mobyle2/local/lib/python2.7/site-packages/gunicorn/workers/sync.py", line 103, in handle_request
    respiter = self.wsgi(environ, resp.start_response)
  File "/root/mobyle2/local/lib/python2.7/site-packages/pyramid/router.py", line 251, in __call__
    response = self.invoke_subrequest(request, use_tweens=True)
  File "/root/mobyle2/local/lib/python2.7/site-packages/pyramid/router.py", line 227, in invoke_subrequest
    response = handle_request(request)
  File "/root/mobyle2/local/lib/python2.7/site-packages/pyramid_debugtoolbar/toolbar.py", line 106, in toolbar_tween
    return handler(request)
  File "/root/mobyle2/local/lib/python2.7/site-packages/pyramid/tweens.py", line 21, in excview_tween
    response = handler(request)
  File "/root/mobyle2/local/lib/python2.7/site-packages/pyramid/router.py", line 117, in handle_request
    root = root_factory(request)
  File "/root/mobyle2/local/lib/python2.7/site-packages/velruse/providers/openid.py", line 246, in callback
    raise ThirdPartyFailure("No OpenID Session has begun.")
ThirdPartyFailure: No OpenID Session has begun.
2012-12-11 13:32:04,980 ERROR [gunicorn.error][MainThread] Error handling request
Traceback (most recent call last):
  File "/root/mobyle2/local/lib/python2.7/site-packages/gunicorn/workers/sync.py", line 103, in handle_request
    respiter = self.wsgi(environ, resp.start_response)
  File "/root/mobyle2/local/lib/python2.7/site-packages/pyramid/router.py", line 251, in __call__
    response = self.invoke_subrequest(request, use_tweens=True)
  File "/root/mobyle2/local/lib/python2.7/site-packages/pyramid/router.py", line 227, in invoke_subrequest
    response = handle_request(request)
  File "/root/mobyle2/local/lib/python2.7/site-packages/pyramid_debugtoolbar/toolbar.py", line 106, in toolbar_tween
    return handler(request)
  File "/root/mobyle2/local/lib/python2.7/site-packages/pyramid/tweens.py", line 21, in excview_tween
    response = handler(request)
  File "/root/mobyle2/local/lib/python2.7/site-packages/pyramid/router.py", line 117, in handle_request
    root = root_factory(request)
  File "/root/mobyle2/local/lib/python2.7/site-packages/velruse/providers/openid.py", line 246, in callback
    raise ThirdPartyFailure("No OpenID Session has begun.")
ThirdPartyFailure: No OpenID Session has begun.
asaladin commented 11 years ago

looks like it's working now. BTW you should deactivate the pyramid debug toolbar, or set it to only recognize pre-defined IP.

osallou commented 11 years ago

it will be deactivated, it was for testing.

I still have the error.

However, while testing with toolbar I see an error in the json.dump of views.py:

TypeError: datetime.date(1974, 7, 29) is not JSON serializable

the dump of the result from openid contains my birthdate, and it fails to serialize it.

asaladin commented 11 years ago

i was able to login on your portal, it worked but not anymore...

asaladin commented 11 years ago

works again just now