Implementing basic authentication with persistence

46 views
Skip to first unread message

Julian Sanchez

unread,
Aug 31, 2017, 12:43:36 PM8/31/17
to pylons-discuss
I'm getting my feet wet with Pyramid and going through the different tutorials, applying the concepts to the project I'm working on.  At the present time I'm interested in having basic authentication and storing the username and (securely hashed) password on a database table.

Is there something already 'pre-made' that I could reuse so I don't have to write all the code from scratch?  I saw the tutorial on SQLAlchemy showing the registration code but we will not be using SQLAlchemy.  The other tutorial gives a flavor for checking the validity of a password but doesn't seem to work with a repository of any kind (particularly a user registering into a site).  I've seen packages like Authomatic but they seem to provide OAuth stuff.  Maybe someone has made an extension to Authomatic for basic authentication?  How are you guys implementing authentication?

Thanks,
Julian

Mikko Ohtamaa

unread,
Aug 31, 2017, 12:45:45 PM8/31/17
to pylons-...@googlegroups.com
Hi Julian,

Websauna implements basic sign in and sign up for you using SQLAlchemy persistency and Redis for sessions:

https://websauna.org/docs/narrative/user/index.html

It also supports Facebook, Twitter and Google OAuth and various others.

Best regards,
Mikko



--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/59dd2c83-b286-4d85-a506-beeaca013322%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Julian Sanchez

unread,
Aug 31, 2017, 12:55:15 PM8/31/17
to pylons-discuss
Thanks Mikko.  I'll take a look at the code.  We won't be using SQLAlchemy though so I'll see how much I can reuse


On Thursday, August 31, 2017 at 11:45:45 AM UTC-5, Mikko Ohtamaa wrote:
Hi Julian,

Websauna implements basic sign in and sign up for you using SQLAlchemy persistency and Redis for sessions:

https://websauna.org/docs/narrative/user/index.html

It also supports Facebook, Twitter and Google OAuth and various others.

Best regards,
Mikko


On 31 August 2017 at 19:42, Julian Sanchez <forei...@gmail.com> wrote:
I'm getting my feet wet with Pyramid and going through the different tutorials, applying the concepts to the project I'm working on.  At the present time I'm interested in having basic authentication and storing the username and (securely hashed) password on a database table.

Is there something already 'pre-made' that I could reuse so I don't have to write all the code from scratch?  I saw the tutorial on SQLAlchemy showing the registration code but we will not be using SQLAlchemy.  The other tutorial gives a flavor for checking the validity of a password but doesn't seem to work with a repository of any kind (particularly a user registering into a site).  I've seen packages like Authomatic but they seem to provide OAuth stuff.  Maybe someone has made an extension to Authomatic for basic authentication?  How are you guys implementing authentication?

Thanks,
Julian

--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discus...@googlegroups.com.
To post to this group, send email to pylons-...@googlegroups.com.

Thierry Florac

unread,
Sep 4, 2017, 3:07:14 AM9/4/17
to pylons-...@googlegroups.com
Hi Julian,
I've build a "security package" for my own framework (called "PyAMS") which includes a pluggable "security manager"' utility in which you can "plug" extensions allowing you to use several authentication plug-ins; these actually include "local users" (stored into ZODB), Authomatic connections or an (optional) LDAP directory; authentication from SQL database is planed but not done yet...
Work on the whole framework is far from finished, packaging and documentation is not done yet but you can have a look to my source code from my repository (http://hg.ztfy.org/pyams).

Best regards,
Thierry

To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/107c600c-d8ce-4836-ad9e-33991e619fc9%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Julian Sanchez

unread,
Sep 4, 2017, 12:37:20 PM9/4/17
to pylons-discuss
Thanks so much for the suggestion Thierry, I'll take a look.

As of now I had found 'pyramid_simpleauth' which seems simple enough yet comprehensive enough for what we need.  Our final solution will be hosted in Google App Engine using the datastore so anything that relies on ZODB or SQLAlchemy for persistence are not good options (no 'translation' to datastore that I'm aware of).  Hopefully your security manager is easier to adapt :)

Cheers,
Julian
Reply all
Reply to author
Forward
0 new messages