Skip to Content
Mastering Flask Web Development - Second Edition
book

Mastering Flask Web Development - Second Edition

by Daniel Gaspar, Jack Stouffer
October 2018
Intermediate to advanced
332 pages
8h 9m
English
Packt Publishing
Content preview from Mastering Flask Web Development - Second Edition

OpenID

To integrate OpenID authentication with our application, we are going to use a new Flask extension named Flask-OpenID, implemented by the Flask creator itself. As always, the extension needs to be added to the requirements.txt file, as follows:

...Flask-OpenID...

Our app will also need a couple of things to implement OpenID:

  • A new form object
  • The form validation in the login and registration pages
  • A callback after the form submission to log the user in or create a new user

In the auth/__init__.py file, the OpenID object can be initialized as follows:

...from flask_openid import OpenID...  
oid = OpenID() 

In the create_module function, the oid object is registered to the app object, as follows:

def create_module(app, **kwargs ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Flask Web Development, 2nd Edition

Flask Web Development, 2nd Edition

Miguel Grinberg
Flask Web Development

Flask Web Development

Miguel Grinberg

Publisher Resources

ISBN: 9781788995405Supplemental Content