当我调用消费者的 complete() 方法时,我收到“发现 [openid 标识符] 后找不到匹配的端点”错误。
有趣的是,在我测试过的四个 OpenID 提供程序中,只有 LiveJournal 才能观察到这种行为。您可以建议哪些步骤来调查和解决问题?
store = FileOpenIDStore("/path/to/store")
def login(req, uri):
req.content_type = "text/html"
session = Session.Session(req)
consumer = Consumer(session, store)
auth = consumer.begin(uri)
util.redirect(req, auth.redirectURL("http://example.com", "http://example.com/authtest.py?sid=" + session.id()))
return
def index(req, sid):
req.content_type = "text/html"
c = Consumer(Session.Session(req, sid), store)
args = req.args.split("&")
arg_dict = {}
for i in range(0, len(args)):
x, y = args[i].split("=")
arg_dict[x] = unquote(y)
v = c.complete(arg_dict, "http://example.com/authtest.py?" + req.args)
if v.status == 'failure':
return v.message
else:
return v.status