问题描述
重定向到其他uri后,如何访问登录的用户属性? 我有此路径/ myapp,可以在成功登录后将用户重定向到/ myapp / index,但是我不确定重定向后如何在函数中访问用户。 我正在使用OpenId connect,并且在映射到/ myapp / index的函数中无法再次登录用户,因为它将最终在SSO重定向循环中出现。
@app.route("/myapp")
@oidc.require_login
def main():
try:
if oidc is None and oidc.user_loggedin is None:
oidc.require_login
except Exception as err:
log.error("Could not authenticate user " + str(err))
return render_template("unauthorized.html")
@app.route("/myapp/index",methods=['GET'])
def index():
#This is always None here
if oidc is not None and oidc.user_loggedin is not None:
print(g.oidc_id_token[ATTRIBUTE])
#rest of the logic
谢谢 凯
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)