This repository has been archived by the owner on Jul 10, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Login functionality through Flask-Login and Flask-OpenID #13
Open
sathyamvellal
wants to merge
11
commits into
pesos:master
Choose a base branch
from
sathyamvellal:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The following requirements were added to support flask login with openid + Flask Login + Flask WTF + Flask OpenID
__init__ module: + Import LoginManager + variable lm now available. Instance of LoginManager
The following methods have been added to the User model required by the Flask Login Extension + is_authenticated + is_active + is_anonymous + get_id
Created a LoginForm class containing a TextField for openid
The following changes were made to support login + Added necessary imports + Global variable 'g' now accessible + Added views '/login', '/logout' + methods to support the login process (user_loader, before_request)
+ extends "base.html" + has a form, 1 field for openid, 1 submit button
The following changes were made to the core module + necessary imports + oid, an instance of OpenID
The following changes have been made to support the openid login functionality through flask login + necessary imports + openid login handler + logout handler + other necessary methods (after_login)
+ CSRF has been enabled + BASEDIR (required to create tmp directory for OpenID)
from flask import Flask | ||
from flask.ext.assets import Environment, Bundle | ||
from flask.ext.sqlalchemy import SQLAlchemy | ||
from flask.ext.login import LoginManager | ||
from flask.ext.openid import OpenID | ||
from settings import BASEDIR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sathyamvellal you should access variables in settings using app.config['BASEDIR']
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ya. I somehow forgot that :-/
Conflicts: src/core/models.py
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello. This pull request adds features for login through openid. The changes that have been made are detailed in the commit messages.
Three TODO have been added to views.py and marked TODO to indicate places that require changes after some developments in the future.
The functionality was checked with a local sqlite database and google openid and worked as expected.
Do examine the request critically and let me know if any additional changes are to be made.