def add_yahoo_login(config, realm=None, storage=None, consumer_key=None, consumer_secret=None, login_path='/login/yahoo', callback_path='/login/yahoo/callback', name='yahoo'): """ Add a Yahoo login provider to the application. OpenID parameters: realm, storage OAuth parameters: consumer_key, consumer_secret """ provider = YahooConsumer(name, realm, storage, consumer_key, consumer_secret) config.add_route(provider.login_route, login_path) config.add_view(provider, attr='login', route_name=provider.login_route, permission=NO_PERMISSION_REQUIRED) config.add_route(provider.callback_route, callback_path, use_global_views=True, factory=provider.callback) register_provider(config, name, provider)
def add_naver_login(config, consumer_key=None, consumer_secret=None, login_path='/login/naver', callback_path='/login/naver/callback', name='naver'): provider = NaverOAuth2Provider( name, consumer_key, consumer_secret, ) config.add_route(provider.login_route, login_path) config.add_view( provider, attr='login', route_name=provider.login_route, permission=NO_PERMISSION_REQUIRED, ) config.add_route( provider.callback_route, callback_path, use_global_views=True, factory=provider.callback, ) register_provider(config, name, provider)
def add_openid_login(config, realm=None, storage=None, login_path='/login/openid', callback_path='/login/openid/callback', name='openid'): """ Add a OpenID login provider to the application. `storage` should be an object conforming to the `openid.store.interface.OpenIDStore` protocol. This will default to `openid.store.memstore.MemoryStore`. """ provider = OpenIDConsumer(name, realm, storage) config.add_route(provider.login_route, login_path) config.add_view(provider.login, route_name=provider.login_route, permission=NO_PERMISSION_REQUIRED) config.add_route(provider.callback_route, callback_path, use_global_views=True, factory=provider.callback) register_provider(config, name, provider)
def add_google_login(config, consumer_key=None, consumer_secret=None, scope=None, login_path='/login/google', callback_path='/login/google/callback', name='google'): """ Add a Google login provider to the application supporting the new OAuth2 protocol. """ provider = GoogleOAuth2Provider( name, consumer_key, consumer_secret, scope) config.add_route(provider.login_route, login_path) config.add_view(provider, attr='login', route_name=provider.login_route, permission=NO_PERMISSION_REQUIRED) config.add_route(provider.callback_route, callback_path, use_global_views=True, factory=provider.callback) register_provider(config, name, provider)
def add_google_login(config, attrs=None, realm=None, storage=None, consumer_key=None, consumer_secret=None, scope=None, login_path='/login/google', callback_path='/login/google/callback', name='google'): """ Add a Google login provider to the application. OpenID parameters: attrs, realm, storage OAuth parameters: consumer_key, consumer_secret, scope """ provider = GoogleConsumer(name, attrs, realm, storage, consumer_key, consumer_secret, scope) config.add_route(provider.login_route, login_path) config.add_view(provider.login, route_name=provider.login_route, permission=NO_PERMISSION_REQUIRED) config.add_route(provider.callback_route, callback_path, use_global_views=True, factory=provider.callback) register_provider(config, name, provider)
def add_linkedin_login(config, consumer_key, consumer_secret, login_path='/linkedin/login', callback_path='/linkedin/login/callback', name='linkedin', scope='', fields=''): """ Add a Last.fm login provider to the application. """ provider = LinkedInProvider(name, consumer_key, consumer_secret, scope=scope, fields=fields) config.add_route(provider.login_route, login_path) config.add_view(provider, attr='login', route_name=provider.login_route, permission=NO_PERMISSION_REQUIRED) config.add_route(provider.callback_route, callback_path, use_global_views=True, factory=provider.callback) register_provider(config, name, provider)
def add_openid_login(config, attrs=None, oattrs=None, realm=None, storage=None, login_path='/login/openid', callback_path='/login/openid/callback', name='openid'): """ Add a OpenID login provider to the application. `attrs` and `oattrs` are required and optional OpenID attributes `storage` should be an object conforming to the `openid.store.interface.OpenIDStore` protocol. This will default to `openid.store.memstore.MemoryStore`. """ provider = OpenIDConsumer(name, attrs=attrs, oattrs=oattrs, realm=realm, storage=storage) config.add_route(provider.login_route, login_path) config.add_view(provider, attr='login', route_name=provider.login_route, permission=NO_PERMISSION_REQUIRED) config.add_route(provider.callback_route, callback_path, use_global_views=True, factory=provider.callback) register_provider(config, name, provider)
def add_github_login(config, consumer_key, consumer_secret, scope=None, login_path='/login/github', callback_path='/login/github/callback', secure=True, domain='github.com', name='github'): """ Add a Github login provider to the application. """ provider = GithubProvider(name, consumer_key, consumer_secret, scope, secure, domain) config.add_route(provider.login_route, login_path) config.add_view(provider, attr='login', route_name=provider.login_route, permission=NO_PERMISSION_REQUIRED) config.add_route(provider.callback_route, callback_path, use_global_views=True, factory=provider.callback) register_provider(config, name, provider)
def add_google_login(config, consumer_key=None, consumer_secret=None, scope=None, login_path='/login/google', callback_path='/login/google/callback', name='google'): """ Add a Google login provider to the application supporting the new OAuth2 protocol. """ provider = GoogleOAuth2Provider(name, consumer_key, consumer_secret, scope) config.add_route(provider.login_route, login_path) config.add_view(provider, attr='login', route_name=provider.login_route, permission=NO_PERMISSION_REQUIRED) config.add_route(provider.callback_route, callback_path, use_global_views=True, factory=provider.callback) register_provider(config, name, provider)
def add_yahoo_login(config, realm=None, storage=None, consumer_key=None, consumer_secret=None, login_path='/login/yahoo', callback_path='/login/yahoo/callback', name='yahoo'): """ Add a Yahoo login provider to the application. OpenID parameters: realm, storage OAuth parameters: consumer_key, consumer_secret """ provider = YahooConsumer(name, realm, storage, consumer_key, consumer_secret) config.add_route(provider.login_route, login_path) config.add_view(provider.login, route_name=provider.login_route, permission=NO_PERMISSION_REQUIRED) config.add_route(provider.callback_route, callback_path, use_global_views=True, factory=provider.callback) register_provider(config, name, provider)
def add_google_login(config, attrs=None, realm=None, storage=None, consumer_key=None, consumer_secret=None, scope=None, login_path='/login/google', callback_path='/login/google/callback', name='google', protocol='hybrid'): """ Add a Google login provider to the application. A Google provider can be configured to use different protocols to authenticate with Google. If ``protocol`` is ``hybrid`` (the default) then it will use OpenID+OAuth. Otherwise, if ``protocol`` is ``oauth2`` then authentication will happen via Google's OAuth2 endpoints. The OpenID+OAuth (hybrid) protocol can be configured for purely authentication by specifying only OpenID parameters. If you also wish to authorize your application to access the user's information you may specify OAuth credentials. - OpenID parameters + ``attrs`` + ``realm`` + ``storage`` - OAuth parameters + ``consumer_key`` + ``consumer_secret`` + ``scope`` The OAuth2 endpoint only requires the ``consumer_key`` and ``consumer_secret`` with an optional ``scope``. """ if protocol == 'oauth2': provider = GoogleOAuth2Provider(name, consumer_key, consumer_secret, scope) else: provider = GoogleConsumer(name, attrs, realm, storage, consumer_key, consumer_secret, scope) config.add_route(provider.login_route, login_path) config.add_view(provider, attr='login', route_name=provider.login_route, permission=NO_PERMISSION_REQUIRED) config.add_route(provider.callback_route, callback_path, use_global_views=True, factory=provider.callback) register_provider(config, name, provider)
def register_steam_provider(config): provider = SteamOpenIDConsumer( 'steam', None, 'http://ohnozombi.es/', None, ) config.add_route(provider.login_route, '/login') config.add_view(provider, attr='login', route_name=provider.login_route, permission=NO_PERMISSION_REQUIRED) config.add_route(provider.callback_route, '/login/callback/', use_global_views=True, factory=provider.callback) register_provider(config, 'steam', provider)
def add_google_login(config, attrs=None, realm=None, storage=None, consumer_key=None, consumer_secret=None, scope=None, login_path='/login/google', callback_path='/login/google/callback', name='google'): """ Add a Google login provider to the application using the OpenID+OAuth hybrid protocol. This protocol can be configured for purely authentication by specifying only OpenID parameters. If you also wish to authorize your application to access the user's information you may specify OAuth credentials. - OpenID parameters + ``attrs`` + ``realm`` + ``storage`` - OAuth parameters + ``consumer_key`` + ``consumer_secret`` + ``scope`` """ provider = GoogleConsumer( name, attrs, realm, storage, consumer_key, consumer_secret, scope) config.add_route(provider.login_route, login_path) config.add_view(provider, attr='login', route_name=provider.login_route, permission=NO_PERMISSION_REQUIRED) config.add_route(provider.callback_route, callback_path, use_global_views=True, factory=provider.callback) register_provider(config, name, provider)
def add_yandex_login( config, consumer_key, consumer_secret, login_path='/login/{name}'.format(name=PROVIDER_NAME), callback_path='/login/{name}/callback'.format(name=PROVIDER_NAME), name=PROVIDER_NAME): """Add a Yandex login provider to the application.""" provider = YandexProvider(name, consumer_key, consumer_secret) config.add_route(provider.login_route, login_path) config.add_view(provider, attr='login', route_name=provider.login_route, permission=NO_PERMISSION_REQUIRED) config.add_route(provider.callback_route, callback_path, use_global_views=True, factory=provider.callback) register_provider(config, name, provider)
def add_twitter_login( config, consumer_key, consumer_secret, login_path="/login/twitter", callback_path="/login/twitter/callback", name="twitter", ): """ Add a Twitter login provider to the application. """ provider = TwitterProvider(name, consumer_key, consumer_secret) config.add_route(provider.login_route, login_path) config.add_view(provider, attr="login", route_name=provider.login_route, permission=NO_PERMISSION_REQUIRED) config.add_route(provider.callback_route, callback_path, use_global_views=True, factory=provider.callback) register_provider(config, name, provider)
def add_bitbucket_login(config, consumer_key, consumer_secret, login_path='/bitbucket/login', callback_path='/bitbucket/login/callback', name='bitbucket'): """ Add a Bitbucket login provider to the application. """ provider = BitbucketProvider(name, consumer_key, consumer_secret) config.add_route(provider.login_route, login_path) config.add_view(provider, attr='login', route_name=provider.login_route, permission=NO_PERMISSION_REQUIRED) config.add_route(provider.callback_route, callback_path, use_global_views=True, factory=provider.callback) register_provider(config, name, provider)
def add_linkedin_login(config, consumer_key, consumer_secret, login_path='/linkedin/login', callback_path='/linkedin/login/callback', name='linkedin'): """ Add a Last.fm login provider to the application. """ provider = LinkedInProvider(name, consumer_key, consumer_secret) config.add_route(provider.login_route, login_path) config.add_view(provider.login, route_name=provider.login_route, permission=NO_PERMISSION_REQUIRED) config.add_route(provider.callback_route, callback_path, use_global_views=True, factory=provider.callback) register_provider(config, name, provider)
def add_weibo_login(config, consumer_key, consumer_secret, login_path='/login/weibo', callback_path='/login/weibo/callback', name='weibo'): """ Add a Weibo login provider to the application. """ provider = WeiboProvider(name, consumer_key, consumer_secret) config.add_route(provider.login_route, login_path) config.add_view(provider.login, route_name=provider.login_route, permission=NO_PERMISSION_REQUIRED) config.add_route(provider.callback_route, callback_path, use_global_views=True, factory=provider.callback) register_provider(config, name, provider)
def add_google_login(config, attrs=None, realm=None, storage=None, consumer_key=None, consumer_secret=None, scope=None, login_path='/login/google', callback_path='/login/google/callback', name='google'): """ Add a Google login provider to the application using the OpenID+OAuth hybrid protocol. This protocol can be configured for purely authentication by specifying only OpenID parameters. If you also wish to authorize your application to access the user's information you may specify OAuth credentials. - OpenID parameters + ``attrs`` + ``realm`` + ``storage`` - OAuth parameters + ``consumer_key`` + ``consumer_secret`` + ``scope`` """ provider = GoogleConsumer(name, attrs, realm, storage, consumer_key, consumer_secret, scope) config.add_route(provider.login_route, login_path) config.add_view(provider, attr='login', route_name=provider.login_route, permission=NO_PERMISSION_REQUIRED) config.add_route(provider.callback_route, callback_path, use_global_views=True, factory=provider.callback) register_provider(config, name, provider)
def add_qq_login(config, consumer_key, consumer_secret, scope=None, login_path='/login/qq', callback_path='/login/qq/callback', name='qq'): """ Add a QQ login provider to the application. """ provider = QQProvider(name, consumer_key, consumer_secret, scope) config.add_route(provider.login_route, login_path) config.add_view(provider, attr='login', route_name=provider.login_route, permission=NO_PERMISSION_REQUIRED) config.add_route(provider.callback_route, callback_path, use_global_views=True, factory=provider.callback) register_provider(config, name, provider)
def add_facebook_login(config, consumer_key, consumer_secret, scope=None, login_path='/login/facebook', callback_path='/login/facebook/callback', name='facebook'): """ Add a Facebook login provider to the application. """ provider = FacebookProvider(name, consumer_key, consumer_secret, scope) config.add_route(provider.login_route, login_path) config.add_view(provider.login, route_name=provider.login_route, permission=NO_PERMISSION_REQUIRED) config.add_route(provider.callback_route, callback_path, use_global_views=True, factory=provider.callback) register_provider(config, name, provider)
def add_yandex_login( config, consumer_key, consumer_secret, login_path='/login/{name}'.format(name=PROVIDER_NAME), callback_path='/login/{name}/callback'.format(name=PROVIDER_NAME), name=PROVIDER_NAME ): """Add a Yandex login provider to the application.""" provider = YandexProvider(name, consumer_key, consumer_secret) config.add_route(provider.login_route, login_path) config.add_view( provider, attr='login', route_name=provider.login_route, permission=NO_PERMISSION_REQUIRED ) config.add_route( provider.callback_route, callback_path, use_global_views=True, factory=provider.callback ) register_provider(config, name, provider)
def add_ubuntu_login(config, realm=None, storage=None, login_path='/login/openid', callback_path='/login/openid/callback'): """ Add an Ubuntu SSO login provider to the application. `storage` should be an object conforming to the `openid.store.interface.OpenIDStore` protocol. This will default to `openid.store.memstore.MemoryStore`. """ provider = UbuntuSSOConsumer(UBUNTU_SSO, realm, storage) config.add_route(provider.login_route, login_path) config.add_view(provider, attr='login', route_name=provider.login_route, permission=NO_PERMISSION_REQUIRED) config.add_route(provider.callback_route, callback_path, use_global_views=True, factory=provider.callback) register_provider(config, UBUNTU_SSO, provider)
def add_yasso_login(config, authorize_url, token_url, userinfo_url, client_id, client_secret, login_path='/login/yasso', callback_path='/login/yasso/callback', name='yasso'): """ Add a Yasso login provider to the application. """ provider = YassoProvider(name, authorize_url, token_url, userinfo_url, client_id, client_secret) config.add_route(provider.login_route, login_path) config.add_view(provider, attr='login', route_name=provider.login_route, permission=NO_PERMISSION_REQUIRED) config.add_route(provider.callback_route, callback_path, use_global_views=True, factory=provider.callback) register_provider(config, name, provider)
def add_google_login(config, attrs=None, realm=None, storage=None, consumer_key=None, consumer_secret=None, scope=None, login_path='/login/google', callback_path='/login/google/callback', name='google', protocol='hybrid'): """ Add a Google login provider to the application. Supports two protocols: OAuth2 and Hybrid (OAuth + OpenID). OpenID parameters: attrs, realm, storage OAuth parameters: consumer_key, consumer_secret, scope """ if protocol == 'oauth2': provider = GoogleOAuth2Provider(name, consumer_key, consumer_secret, scope) else: provider = GoogleConsumer(name, attrs, realm, storage, consumer_key, consumer_secret, scope) config.add_route(provider.login_route, login_path) config.add_view(provider, attr='login', route_name=provider.login_route, permission=NO_PERMISSION_REQUIRED) config.add_route(provider.callback_route, callback_path, use_global_views=True, factory=provider.callback) register_provider(config, name, provider)
def add_google_login(config, attrs=None, realm=None, storage=None, consumer_key=None, consumer_secret=None, scope=None, login_path='/login/google', callback_path='/login/google/callback', name='google', protocol='hybrid'): """ Add a Google login provider to the application. A Google provider can be configured to use different protocols to authenticate with Google. If ``protocol`` is ``hybrid`` (the default) then it will use OpenID+OAuth. Otherwise, if ``protocol`` is ``oauth2`` then authentication will happen via Google's OAuth2 endpoints. The OpenID+OAuth (hybrid) protocol can be configured for purely authentication by specifying only OpenID parameters. If you also wish to authorize your application to access the user's information you may specify OAuth credentials. - OpenID parameters + ``attrs`` + ``realm`` + ``storage`` - OAuth parameters + ``consumer_key`` + ``consumer_secret`` + ``scope`` The OAuth2 endpoint only requires the ``consumer_key`` and ``consumer_secret`` with an optional ``scope``. """ if protocol == 'oauth2': provider = GoogleOAuth2Provider( name, consumer_key, consumer_secret, scope) else: provider = GoogleConsumer( name, attrs, realm, storage, consumer_key, consumer_secret, scope) config.add_route(provider.login_route, login_path) config.add_view(provider, attr='login', route_name=provider.login_route, permission=NO_PERMISSION_REQUIRED) config.add_route(provider.callback_route, callback_path, use_global_views=True, factory=provider.callback) register_provider(config, name, provider)