import base64 from mandaye.auth.saml2 import SAML2Auth class SamlArcopoleAuth(SAML2Auth): """ Overload replay for arcopole """ def replay(self, env, post_values): """ we need to b64encode the password for arcopole """ pwd = self.form_values['password_field'] post_values[pwd] = base64.b64encode(post_values[pwd]) return super(SamlArcopoleAuth, self).replay(env, post_values)