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


Python Client.auth_uri方法代码示例

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


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

示例1: handle_github

# 需要导入模块: from sanction.client import Client [as 别名]
# 或者: from sanction.client.Client import auth_uri [as 别名]
 def handle_github(self, data):
     self.send_response(302)
     c = Client(auth_endpoint='https://github.com/login/oauth/authorize',
             client_id=config['github.client_id'],
             redirect_uri='http://localhost/login/github')
     self.send_header('Location', c.auth_uri())
     self.end_headers()
开发者ID:kobeBigs,项目名称:sanction,代码行数:9,代码来源:server.py

示例2: handle_foursquare

# 需要导入模块: from sanction.client import Client [as 别名]
# 或者: from sanction.client.Client import auth_uri [as 别名]
 def handle_foursquare(self, data):
     self.send_response(302)
     c = Client(auth_endpoint='https://foursquare.com/oauth2/authenticate',
             client_id=config['foursquare.client_id'],
             redirect_uri='http://localhost/login/foursquare')
     self.send_header('Location', c.auth_uri())
     self.end_headers()
开发者ID:kobeBigs,项目名称:sanction,代码行数:9,代码来源:server.py

示例3: handle_stackexchange

# 需要导入模块: from sanction.client import Client [as 别名]
# 或者: from sanction.client.Client import auth_uri [as 别名]
 def handle_stackexchange(self, data):
     self.send_response(302)
     c = Client(auth_endpoint="https://stackexchange.com/oauth",
         client_id=config["stackexchange.client_id"],
         redirect_uri="http://localhost/login/stackexchange")
     self.send_header("Location", c.auth_uri())
     self.end_headers()
开发者ID:Raekkeri,项目名称:sanction,代码行数:9,代码来源:server.py

示例4: handle_instagram

# 需要导入模块: from sanction.client import Client [as 别名]
# 或者: from sanction.client.Client import auth_uri [as 别名]
 def handle_instagram(self, data):
     self.send_response(302)
     c = Client(auth_endpoint='https://api.instagram.com/oauth/authorize/',
             client_id=config['instagram.client_id'],
             redirect_uri='http://localhost/login/instagram')
     self.send_header('Location', c.auth_uri())
     self.end_headers()
开发者ID:kobeBigs,项目名称:sanction,代码行数:9,代码来源:server.py

示例5: handle_instagram

# 需要导入模块: from sanction.client import Client [as 别名]
# 或者: from sanction.client.Client import auth_uri [as 别名]
	def handle_instagram(self, data):
		self.send_response(302)
		c = Client(auth_endpoint="https://api.instagram.com/oauth/authorize/",
				client_id=config["instagram.client_id"],
				redirect_uri="http://localhost:8080/login/instagram")
		self.send_header("Location", c.auth_uri())
		self.end_headers()
开发者ID:AlecTaylor,项目名称:sanction,代码行数:9,代码来源:server.py

示例6: handle_bitly

# 需要导入模块: from sanction.client import Client [as 别名]
# 或者: from sanction.client.Client import auth_uri [as 别名]
	def handle_bitly(self, data):
		self.send_response(302)
		c = Client(auth_endpoint="https://bitly.com/oauth/authorize",
				client_id=config["bitly.client_id"],
				redirect_uri="http://localhost:8080/login/bitly")
		self.send_header("Location", c.auth_uri())
		self.end_headers()
开发者ID:AlecTaylor,项目名称:sanction,代码行数:9,代码来源:server.py

示例7: handle_foursquare

# 需要导入模块: from sanction.client import Client [as 别名]
# 或者: from sanction.client.Client import auth_uri [as 别名]
	def handle_foursquare(self, data):
		self.send_response(302)
		c = Client(auth_endpoint="https://foursquare.com/oauth2/authenticate",
				client_id=config["foursquare.client_id"],
				redirect_uri="http://localhost:8080/login/foursquare")
		self.send_header("Location", c.auth_uri())
		self.end_headers()
开发者ID:AlecTaylor,项目名称:sanction,代码行数:9,代码来源:server.py

示例8: handle_google

# 需要导入模块: from sanction.client import Client [as 别名]
# 或者: from sanction.client.Client import auth_uri [as 别名]
 def handle_google(self, data):
     self.send_response(302)
     c = Client(auth_endpoint="https://accounts.google.com/o/oauth2/auth",
         client_id=config["google.client_id"],
         redirect_uri="http://localhost/login/google")
     self.send_header("Location", c.auth_uri(
         scope=config["google.scope"].split(","), access_type="offline"))    
     self.end_headers()
开发者ID:Raekkeri,项目名称:sanction,代码行数:10,代码来源:server.py

示例9: handle_deviantart

# 需要导入模块: from sanction.client import Client [as 别名]
# 或者: from sanction.client.Client import auth_uri [as 别名]
 def handle_deviantart(self, data):
     self.send_response(302)
     c = Client(
         auth_endpoint='https://www.deviantart.com/oauth2/draft15/authorize',
         client_id=config['deviantart.client_id'],
         redirect_uri=config['deviantart.redirect_uri'])
     self.send_header('Location', c.auth_uri())
     self.end_headers()
开发者ID:kobeBigs,项目名称:sanction,代码行数:10,代码来源:server.py

示例10: handle_facebook

# 需要导入模块: from sanction.client import Client [as 别名]
# 或者: from sanction.client.Client import auth_uri [as 别名]
 def handle_facebook(self, data):
     self.send_response(302)
     c = Client(auth_endpoint='https://www.facebook.com/dialog/oauth',
             client_id=config['facebook.client_id'],
             redirect_uri='http://localhost/login/facebook')
     self.send_header('Location', c.auth_uri(
         scope=config['facebook.scope'].split(','),
         scope_delim=','))
     self.end_headers()
开发者ID:kobeBigs,项目名称:sanction,代码行数:11,代码来源:server.py

示例11: get_oauth2_starter_url

# 需要导入模块: from sanction.client import Client [as 别名]
# 或者: from sanction.client.Client import auth_uri [as 别名]
def get_oauth2_starter_url(provider_name, csrf_token):
    """returns redirect url for the oauth2 protocol for a given provider"""
    from sanction.client import Client

    providers = get_enabled_login_providers()
    params = providers[provider_name]
    client_id = getattr(askbot_settings, provider_name.replace("-", "_").upper() + "_KEY")
    redirect_uri = site_url(reverse("user_complete_oauth2_signin"))
    client = Client(auth_endpoint=params["auth_endpoint"], client_id=client_id, redirect_uri=redirect_uri)
    return client.auth_uri(state=csrf_token, **params.get("extra_auth_params", {}))
开发者ID:keto,项目名称:askbot-devel,代码行数:12,代码来源:util.py

示例12: test_get_auth_uri

# 需要导入模块: from sanction.client import Client [as 别名]
# 或者: from sanction.client.Client import auth_uri [as 别名]
    def test_get_auth_uri(self):
        c = Client(auth_endpoint = auth_endpoint,
            client_id = client_id)
        uri = c.auth_uri()

        o = urlparse(uri)
        self.assertEquals(o.netloc, "example.com")
        d = dict(parse_qsl(o.query))

        self.assertEquals(d["response_type"], "code")
        self.assertEquals(d["client_id"], client_id)
开发者ID:brianru,项目名称:sanction,代码行数:13,代码来源:tests.py

示例13: get_oauth2_starter_url

# 需要导入模块: from sanction.client import Client [as 别名]
# 或者: from sanction.client.Client import auth_uri [as 别名]
def get_oauth2_starter_url(provider_name):
    """returns redirect url for the oauth2 protocol for a given provider"""
    from sanction.client import Client
    providers = get_enabled_login_providers()
    params = providers[provider_name]
    client_id = getattr(askbot_settings, provider_name.upper() + '_KEY')
    redirect_uri = askbot_settings.APP_URL + reverse('user_complete_oauth2_signin')
    client = Client(
        auth_endpoint=params['auth_endpoint'],
        client_id=client_id,
        redirect_uri=redirect_uri
    )
    return client.auth_uri()
开发者ID:yingchauhuang,项目名称:justask,代码行数:15,代码来源:util.py

示例14: get_oauth2_starter_url

# 需要导入模块: from sanction.client import Client [as 别名]
# 或者: from sanction.client.Client import auth_uri [as 别名]
def get_oauth2_starter_url(provider_name, csrf_token):
    """returns redirect url for the oauth2 protocol for a given provider"""
    from sanction.client import Client

    providers = get_enabled_login_providers()
    params = providers[provider_name]
    client_id = getattr(askbot_settings, format_setting_name(provider_name) + '_KEY')
    redirect_uri = site_url(reverse('user_complete_oauth2_signin'))
    client = Client(
        auth_endpoint=params['auth_endpoint'],
        client_id=client_id,
        redirect_uri=redirect_uri
    )
    return client.auth_uri(state=csrf_token, **params.get('extra_auth_params', {}))
开发者ID:appfolio,项目名称:askbot-devel,代码行数:16,代码来源:util.py

示例15: get_oauth2_starter_url

# 需要导入模块: from sanction.client import Client [as 别名]
# 或者: from sanction.client.Client import auth_uri [as 别名]
def get_oauth2_starter_url(provider_name, csrf_token):
    """returns redirect url for the oauth2 protocol for a given provider"""
    from sanction.client import Client

    providers = get_enabled_login_providers()
    params = providers[provider_name]
    client_id = getattr(askbot_settings, provider_name.upper() + '_KEY')
    redirect_uri = site_url(reverse('user_complete_oauth2_signin'))
    #qq = redirect_uri.split(':')
    #nurl = qq[0]+':'+qq[1]+qq[2][qq[2].find('/'):]
    #redirect_uri=nurl
    client = Client(
        auth_endpoint=params['auth_endpoint'],
        client_id=client_id,
        redirect_uri=redirect_uri
    )
    return client.auth_uri(state=csrf_token)
开发者ID:liyonghelpme,项目名称:myAskbot,代码行数:19,代码来源:util.py


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