Created
December 11, 2013 03:10
-
-
Save magmastonealex/7904565 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
from openid.store import filestore | |
from openid.consumer import consumer | |
from lib.persistDict import getDict | |
from lib.login import * | |
import sha | |
import web | |
class openid_fin: | |
def GET(self): | |
dicti = {} | |
dicti = getDict() | |
#return "ERR." | |
print "------------------------" | |
print dicti | |
oidconsumer = consumer.Consumer(dicti, filestore.FileOpenIDStore("nonce")) | |
cons = oidconsumer.complete(web.input(), web.ctx.homedomain+"/openid_fin") | |
# print con | |
if cons.status == consumer.SUCCESS: | |
shah = sha.new(cons.getDisplayIdentifier()) | |
shah = shah.hexdigest() | |
testtok = web.cookies(token="blank")["token"] | |
#print "TOK:::::"+testtok | |
tok = get_token(shah) | |
if tok != False: | |
#print "Issuing token & logging in." | |
web.setcookie("token", tok) | |
web.setcookie("uniqid", shah) | |
login(shah, tok) | |
#print "Done." | |
web.found("/") | |
elif cons.status == consumer.FAILURE: | |
return "Hax." | |
elif cons.status == consumer.CANCEL: | |
web.found("/") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment