#586: Extend Invenio connector to support CERN SSO
-------------------------+-----------------
Reporter: skaplun | Owner:
Type: enhancement | Status: new
Priority: minor | Milestone:
Component: BibMatch | Version:
Keywords: CERN |
-------------------------+-----------------
It would be great to use Invenio-connector in an authenticated way. At
CERN this would mean login through the SSO.
For this the only scriptable way would be to use mechanize to perform the
login and then to pass the Invenio session.
The procedure to login via SSO via mechanize is:
{{{
class _SGMLParserFactory( mechanize.DefaultFactory):
def __init__(self, i_want_broken_xhtml_support=False):
forms_factory = mechanize.FormsFactory(
form_parser_class=ClientForm.XHTMLCompatibleFormParser)
mechanize.Factory.__init__(
self,
forms_factory=forms_factory,
links_factory=mechanize.LinksFactory(),
title_factory=mechanize.TitleFactory(),
response_type_finder=mechanize._html.ResponseTypeFinder(
allow_xhtml=i_want_broken_xhtml_support),
)
def _check_shibboleth():
user, password = _load_credentials()
br =
mechanize.Browser(factory=_SGMLParserFactory(i_want_broken_xhtml_support=True))
br.set_handle_robots(False)
br.open("http://cdsweb.cern.ch/")
br.follow_link(text_regex="login")
br.select_form(nr=0)
br.form['ctl00$ContentPlaceHolder1$txtFormsLogin'] = user
br.form['ctl00$ContentPlaceHolder1$txtFormsPassword'] = password
br.submit()
br.select_form(nr=0)
br.submit()
}}}
at this point ''br'' variable (the browser) should have an invenio-session
cookie and SSO cookies that should be passed somehow to Invenio-connector
to simulate a logged in user.
--
Ticket URL: <http://invenio-software.org/ticket/586>
Invenio <http://invenio-software.org>