Skip to main content

Integrate Google, Facebook, Github & Twitter login in kivy applications

Project description

KivyAuth

Integrate Google, Facebook, Github & Twitter login in kivy applications

build Python 3.6 pypi license format downloads

Demo Gif

Installation

It can be installed via pip

pip install kivyauth

How to use

The example below shows the basic usage of the library by integrating google login.

  • Add prerequisite for google login before proceeding further

  • Include necessary imports, for example, in case of google login

from kivyauth.initialize import initialize_google
from kivyauth.logins import login_google, logout, login_providers
  • Initialize google login inside your app's build method
def build(self):
  #..
  self.mGSignInClient= initialize_google(self.success_listener, self.error_listener, RC_SIGN_IN)
  #..

success_listener is a function to be called upon successful login with name, email, and photo url of the user. So, create a success listener function which accepts three parameters and perform after-login stuffs. error_listener doesn't accept any argument. RC_SIGN_IN is just a unique request code used to differentiate among different requests. Define it an integer constant.

  • Next, add below code inside a function to be called when user clicks the login button.
login_google(self.mGSignInClient, RC_SIGN_IN)
self.current_provider= login_providers.google
  • To logout
logout(self.current_provider, self.after_logout)
  • Make sure to include kivyauth as a requirement in the buildozer.spec file
requirements = python3,kivy,kivyauth
  • See demo for reference

A more comprehensive documentation is on it's way.

Other

Feel free to ping me or raise issues if there's any difficulty in packaging it up.

Star this repo if you think it's useful.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

KivyAuth-2.0.tar.gz (4.7 kB view hashes)

Uploaded Source

Built Distribution

KivyAuth-2.0-py3-none-any.whl (6.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page