Repository: evansmwendwa/python-socialite (language: python)

Issue:
Feature docs
Update docs to current version


Discussion / hints:

Fix patch:
diff --git a/.gitignore b/.gitignore
index 84d0238..334df60 100644
--- a/.gitignore
+++ b/.gitignore
@@ -108,3 +108,5 @@ test.py
 .nox/
 Notes
 .pypirc
+manual_test.py
+*Zone.Identifier
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1d503e9..3746ae5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,15 @@ Here you can see the full list of changes between python-socialite versions.
 Versions are in form of *headline.major.minor* numbers.
 Backwards-compatible changes increment the minor version number only.
 
+Version 0.1.4
+-------------
+
+Released: 2021-02-07
+
+-   Cleanup docs
+-   Fix google login
+
+
 Version 0.1.3
 -------------
 
diff --git a/LICENSE b/LICENSE
index c98dba4..ece3d7e 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
 MIT License
 
-Copyright (c) 2020, Evans Mwendwa
+Copyright (c) 2021, Evans Mwendwa
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
diff --git a/MANIFEST.in b/MANIFEST.in
index e4190a6..39dfbd1 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,7 +1,7 @@
 graft src
 include *.md LICENSE
 
-exclude .flake8 noxfile.py .coveragerc
+exclude .flake8 noxfile.py .coveragerc manual_test.py manual_test.example banner.png
 prune tests
 prune scripts
 
diff --git a/README.md b/README.md
index 3fdc71e..9081536 100644
--- a/README.md
+++ b/README.md
@@ -8,28 +8,38 @@
 
 </p>
 
-Simple and convenient oAuth Login user provider for Facebook, Twitter, LinkedIn, Google, GitHub, GitLab and Bitbucket. Inspired by [Laravel Socialite](https://laravel.com/docs/master/socialite)
+<img src="https://raw.githubusercontent.com/evansmwendwa/python-socialite/master/banner.png" alt="" />
+
+## The easy way to retrieve OAuth 2.0 Tokens from any provider
+
+Simple and convenient way for fetching OAuth 2.0 tokens from any provider. Out of the box support for Facebook, Twitter, LinkedIn, Google, GitHub, GitLab and Bitbucket. Inspired by [Laravel Socialite](https://laravel.com/docs/master/socialite)
 
 ## Features
 -   Supports multiple common providers
--   Supports any oAuth 2 compliant providers
+-   Supports any oAuth 2 compliant providers (You can provide a custom driver)
 -   Straighforward unopinionated authentication
 -   Can be implemented in any python framework
 
 ## Usage
 
+### Installation
+
+```shell
+pip install python-socialite
+```
+
 ### Generate redirect uri
 ```python
-from python_socialite import AuthProvider
+from python_socialite import OAuthProvider
 
 config = {
     "google": {
         "client_id": "",
         "client_secret": "",
-        "redirect_uri": ""
+        "redirect_url": ""
     }
 }
-provider = AuthProvider("google", config)
+provider = OAuthProvider("google", config)
 redirect_url = provider.get_auth_url()
 
 # redirect user to the redirect_url using your frameworks supported redirect
@@ -38,29 +48,26 @@ redirect_url = provider.get_auth_url()
 ### Retrieving Access Token and User
 
 ```python
-code = "" # read code from GET variables
-provider = AuthProvider("google", config)
-
-try:
-    token = provider.get_token(code)
-    user = provider.get_user(token["access_token"])
-except:
-    pass
+code = "" # read code from GET variables in the url the provider redirected you to
+provider = OAuthProvider("google", config)
+
+token = provider.get_token(code)
+user = provider.get_user(token["access_token"])
 ```
 
-Hook the returned user profile to your apps authentication.
+This package does not provide opinion on how you use the returned token or user profile. Add that to your application's business logic. Examples include hooking up to your authentication logic, fetching data associated with the returned access token e.t.c
 
 ### Token Template
 
-**NB:** Token attributes might vary between providers. Here's a sample returned by Google
+**NB:** Token attributes might vary between providers. Here's a sample returned by Google oAuth
 
 ```json
 {
-   "access_token":"ya29.***",
-   "expires_in":3599,
-   "scope":"https://www.googleapis.com/auth/userinfo.profile openid",
-   "token_type":"Bearer",
-   "id_token":"***jwt***"
+   "access_token": "ya29.***",
+   "expires_in": 3599,
+   "scope": "https://www.googleapis.com/auth/userinfo.profile openid",
+   "token_type": "Bearer",
+   "id_token": "***jwt***"
 }
 ```
 
@@ -100,7 +107,7 @@ auth_url = provider.set_scopes(["openid", "email", "profile"]).get_auth_url()
 The config must be a dict containing keys of any of the supported providers
 
 ```python
-# each provider key must have client_id, client_secret and redirect_url
+# each provider key must have client_id, client_secret and redirect_url. It's advised to ensure your client_secret is properly secured
 
 config = {
     "google": {
diff --git a/banner.png b/banner.png
new file mode 100644
index 0000000..de2335e
Binary files /dev/null and b/banner.png differ
diff --git a/src/python_socialite/__init__.py b/src/python_socialite/__init__.py
index fb72e0c..b8f81e5 100644
--- a/src/python_socialite/__init__.py
+++ b/src/python_socialite/__init__.py
@@ -2,4 +2,4 @@
 
 __author__ = """Evans Mwendwa"""
 __email__ = "evans@authenticvisualsmedia.com"
-__version__ = "0.1.3"
+__version__ = "0.1.4"


Test patch:
diff --git a/manual_test.example b/manual_test.example
new file mode 100644
index 0000000..a9ae240
--- /dev/null
+++ b/manual_test.example
@@ -0,0 +1,24 @@
+from python_socialite.python_socialite import OAuthProvider
+
+config = {
+    "google": {
+        "client_id": "xxxxxxxxxxxxxxxxxxxxxxxxx",
+        "client_secret": "xxxxxxxxxxxxxxxxxxxxxxxx",
+        "redirect_url": "http://localhost"
+    }
+}
+provider = OAuthProvider("google", config)
+redirect_url = provider.get_auth_url()
+print(redirect_url)
+
+# read code from GET variables
+code = "xxxxxxxxxxxxxxxxxxxxxxxxxxx" 
+
+try:
+    token = provider.get_token(code)
+    user = provider.get_user(token["access_token"])
+    print(token)
+    print(" ")
+    print(user)
+except:
+    pass