Hi Enrico,
Newer versions of TG don't use the sqlalchemy plugin of repoze anymore,
that was replace by the authenticate method in ApplicationAuthMetadata.
See
https://turbogears.readthedocs.io/en/latest/turbogears/authentication.html?highlight=authenticate#authenticating-user
and
https://turbogears.readthedocs.io/en/latest/turbogears/authentication.html?highlight=authenticate#customizing-the-model-structure-assumed-by-the-quickstart
for
a small example. So you should be able to add an "authenticate" method
to ApplicationAuthMetadata and get rid of repoze.who.plugins.sa
Regarding ApplicationAuthMetadata itself, you want to initialise it with
the specific arguments it needs instead of passing the whole `sa_auth`
object. You can of course pass base_config.get_blueprint_view("sa_auth") to
do exactly what you were doing before, but I'd say it's just best to pass
the explicit things that you want in __init__
On Wed, Sep 18, 2019 at 2:30 PM Enrico Secco <[email protected]>
wrote:
> Hi, I'm trying to implement a connection to the active directory system of
> my domain.
> In the documentation I find the necessary change to the app_cgf.py file.
> But it seems to me related to the old versions because it uses:
> base_config.auth_backend = 'ldapauth'
> without using the new method: base_config.update_blueprint
> I tried to translate the code for 2.4, assuming I could transform (I don't
> know if it is correct ...):
> base_config.sa_auth.cookie_secret = 'secret'
> base_config.auth_backend = 'ldapauth'
>
> in:
> base_config.update_blueprint ({
> 'sa_auth.cookie_secret': 'secret',
> 'auth_backend': 'ldapauth',
> })
>
>
> But when I go to define:
> class ApplicationAuthMetadata (TGAuthMetadata):
> def __init __ (self, sa_auth):
> self.sa_auth = sa_auth
>
> to then connect it to the configuration:
> base_config.sa_auth.authmetadata = ApplicationAuthMetadata (
> base_config.sa_auth)
>
>
> with the update_blueprint method I cannot pass the sa_auth parameter which
> is not defined.
>
> base_config.update_blueprint ({
> 'sa_auth.authmetadata': ApplicationAuthMetadata (?????????????)
> })
>
>
> I get the impression that there are also repoze.who problems because I had
> to modify repoze.who.plugins.sa (implements -> @implementer). So maybe
> python3 porting is not yet possible ...
>
> Any advice is appreciated.
> Thanks in advance.
> Enrico
>
> --
> You received this message because you are subscribed to the Google Groups
> "TurboGears" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/turbogears/cbe07668-6710-4ebc-8a30-6cd676161bcc%40googlegroups.com
> <https://groups.google.com/d/msgid/turbogears/cbe07668-6710-4ebc-8a30-6cd676161bcc%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/turbogears/CAJfq2JFPGjsoj0_Pasm4_5XdizUEksju4otSoSSBRcTs%3D%3DtHPA%40mail.gmail.com.