本文整理汇总了Python中socialregistration.utils.OAuthClient.get_redirect方法的典型用法代码示例。如果您正苦于以下问题:Python OAuthClient.get_redirect方法的具体用法?Python OAuthClient.get_redirect怎么用?Python OAuthClient.get_redirect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类socialregistration.utils.OAuthClient
的用法示例。
在下文中一共展示了OAuthClient.get_redirect方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: oauth_redirect
# 需要导入模块: from socialregistration.utils import OAuthClient [as 别名]
# 或者: from socialregistration.utils.OAuthClient import get_redirect [as 别名]
def oauth_redirect(
request,
consumer_key=None,
secret_key=None,
request_token_url=None,
access_token_url=None,
authorization_url=None,
callback_url=None,
parameters=None,
):
"""
View to handle the OAuth based authentication redirect to the service provider
"""
request.session["next"] = _get_next(request)
client = OAuthClient(
request,
consumer_key,
secret_key,
request_token_url,
access_token_url,
authorization_url,
callback_url,
parameters,
)
return client.get_redirect()
示例2: oauth_redirect
# 需要导入模块: from socialregistration.utils import OAuthClient [as 别名]
# 或者: from socialregistration.utils.OAuthClient import get_redirect [as 别名]
def oauth_redirect(request, consumer_key=None, secret_key=None,
request_token_url=None, access_token_url=None, authorization_url=None,
callback_url=None, parameters=None):
"""
View to handle the OAuth based authentication redirect to the service provider
"""
request.session['socialregistration_connect_object'] = get_object(request.GET)
request.session['next'] = _get_next(request)
client = OAuthClient(request, consumer_key, secret_key,
request_token_url, access_token_url, authorization_url, callback_url, parameters)
return client.get_redirect()