Odoo Help


OpenID 2.0 Shutdown and adding the openid_shutdown_ack to the OpenID 2.0 request

Joeri Belis
on 1/4/15, 1:54 PM 1,316 views

OpenID 2.0 Shutdown Timetable - https://developers.google.com/accounts/docs/OpenID -

Google lets me buy some extra time to do a migration, but i want to add the openid_shutdown_ack parameter.

So i think i need to modify addons/auth_openid/controllers/main.py

see here my changes ( bold line ) , but is this the right way to add the parameter to the OpenID 2.0 request

And how can i check if it is working?

def _verify(self, req, db, url):
         redirect_to = werkzeug.urls.Href(req.httprequest.host_url + 'auth_openid/login/process')(session_id=req.session_id)
         realm = self._get_realm(req)

         session = dict(dbname=db, openid_url=url)       # TODO add origin page ?
         oidconsumer = consumer.Consumer(session, self._store)

             request = oidconsumer.begin(url)
         except consumer.DiscoveryFailure, exc:
             fetch_error_string = 'Error in discovery: %s' % (str(exc[0]),)
             return {'error': fetch_error_string, 'title': 'OpenID Error'}

         if request is None:
             return {'error': 'No OpenID services found', 'title': 'OpenID Error'}

         req.session.openid_session = session
         # openid_shutdown_ack


Joeri Belis
On 1/6/15, 2:16 PM

I found a way to extend the AuthRequest method getMessage so it wil add the parameter. But not sure google is processing it as i expect.

I add a fuction that will extend the getMessage of consumer.AuthRequest

def extend_with_openid_shutdown_ack(self, realm, return_to=None, immediate=False):
     message = consumer.AuthRequest.getMessage(self, realm, return_to, immediate)
     message.setArg(consumer.BARE_NS, 'openid_shutdown_ack','2015-04-20')
     return message

and in the _verify method i extend getMessage method

request.getMessage = extend_with_openid_shutdown_ack.__get__(request, type(request))






About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)


Asked: 1/4/15, 1:54 PM
Seen: 1316 times
Last updated: 3/16/15, 8:10 AM