当前位置: 首页>>代码示例>>Python>>正文


Python ServiceApi.signon_user方法代码示例

本文整理汇总了Python中service_api.ServiceApi.signon_user方法的典型用法代码示例。如果您正苦于以下问题:Python ServiceApi.signon_user方法的具体用法?Python ServiceApi.signon_user怎么用?Python ServiceApi.signon_user使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在service_api.ServiceApi的用法示例。


在下文中一共展示了ServiceApi.signon_user方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: signon

# 需要导入模块: from service_api import ServiceApi [as 别名]
# 或者: from service_api.ServiceApi import signon_user [as 别名]
def signon():
    def nav():
        if 'login_redir' in session:
            return redirect(session.pop('login_redir'))

        return redirect('/')

    user_name = request.args.get('user')
    
    if user_name:
        if not PRODUCTION:
            ServiceApi.signon_user_testmode(user_name)
        return nav()

    # carriage returns were removed on the cilogon portal side,
    # restore them before processing
    raw_cert = request.args.get('cert')
    if not raw_cert:
        return nav()

    certificate = base64.b64decode(raw_cert)

    # call backend to signon user
    # will stash user id, expiry, is_registered and roles in session
    ServiceApi.signon_user(certificate)

    return nav()
开发者ID:Bobfrat,项目名称:ion-ux,代码行数:29,代码来源:main.py

示例2: signon

# 需要导入模块: from service_api import ServiceApi [as 别名]
# 或者: from service_api.ServiceApi import signon_user [as 别名]
def signon():
    user_name = request.args.get('user')
    if user_name:
        ServiceApi.signon_user_testmode(user_name)
        return redirect('/')
    
    # carriage returns were removed on the cilogon portal side,
    # restore them before processing
    raw_cert = request.args.get('cert')
    if not raw_cert:
        return redirect('/')

    certificate = base64.b64decode(raw_cert)

    # call backend to signon user
    # will stash user id, expiry, is_registered and roles in session
    ServiceApi.signon_user(certificate)    

    if session['is_registered'] == False:
        # redirect to registration screen
        return redirect('/userprofile')
    else:
        return redirect('/')
开发者ID:seman,项目名称:ion-ux,代码行数:25,代码来源:main.py


注:本文中的service_api.ServiceApi.signon_user方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。