Lasso FAQ
=========
Generalities
------------
1. What is Lasso ?
Lasso is a C library which implements the identity federation and single-sign
on protocol standards ID-FF 1.2 and SAML 2.0. It also implements attribute
exchange
2. What does Lasso mean ?
Lasso is the acronym of Liberty Alliance Single Sign On.
2. What is Liberty Alliance ?
It'a consortium built to propose a common XML standard for transmitting
information about authentication and identity, made in response to the
Microsoft Passport technology. It has since been dismantled and all its assets
are now managed by the Oasis standard body and the Kantara initiative.
The more recent standard coming from the initial Liberty Alliance initiative
is SAML 2.0.
Use of the library
------------------
1. How to make a simple POST assertion consumer using Python ?
Using Python&WSGI:
.. code-block:: python
import sys
import lasso
from wsgiref.simple_server import make_server
import logging
import urlparse
logging.basicConfig(level=logging.DEBUG)
sp_metadata_xml = '''
echo htmlentities($msg); ?>exit(0); } try { try { $login->processAuthnResponseMsg($_POST["SAMLResponse"]); } catch (LassoDsError $e) { error('Invalid signature'); } catch (LassoProfileCannotVerifySignatureError $e) { error('Invalid signature'); } catch (LassoError $e) { error('Misc error, ' . $e); } try { $login->acceptSso(); } catch (LassoError $e) { error('Invalid assertion'); } } catch (Exception $e) { error('Unexpected error: ' . $e); } ?> You are identified as echo $login->assertion->subject->nameId->content; You must replace the ``$idp_metadata_xml`` variable by your identity provider metadata. You can indicate to your identity provider the URL http://yourdomain.com/index.php?metadata as the URL of your metadata file. 3. I received a request or a response, how do I find out which provider sent it before parsing it with Lasso ? A profile needs a provider to be loaded in their server object before parsing any message from it. If you manage a lot of providers and you do not want to always load all of them you can use the lasso_profile_get_issuer() function if the message is sent using the SOAP, HTTP-POST or HTTP-Redirect bindings. .. code-block:: python # POST case import lasso msg = request.POST['SAMLRequest'] provider_id = lasso.Profile.getIssuser(msg) # GET case msg = request.META['QUERY_STRING'] provider_id = lasso.Profile.getIssuer(msg) # SOAP case msg = request.read() provider_id = lasso.Profile.getIssuer(msg) The python example is pseudo-code. It assumes there is a request object whom you can retrieve a POST parameters, the query string or the POST body.