Metadata-Version: 2.0
Name: django-simpletwitchauth
Version: 1.0
Summary: Use this simple module to easily enable authorization in your Django application via Twitch API
Home-page: https://github.com/ALikhachev/django-simpletwitchauth
Author: Alexander Likhachev
Author-email: likhachev96@gmail.com
License: MIT License
Keywords: django auth authentication twitch external api
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 1.8
Classifier: Framework :: Django :: 1.9
Classifier: Framework :: Django :: 1.10
Classifier: Framework :: Django :: 1.11
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: Django (>=1.8)
Requires-Dist: requests

Simple Twitch auth
==================

| Wanna enable your awesome Django application to register and
  authenticate user using Twitch profiles?
| This application was created especially for your needs

Features
--------

-  Easy to use
-  Ready to Twitch channel name changes
-  Username cases are synchronized to Twitch display\_name
-  User emails are synchronized to Twitch

Installation
------------

Ensure that `Django ‘sites’ framework`_ is enabled.

Python package:
~~~~~~~~~~~~~~~

::

    pip install django-simpletwitchauth

settings.py:
~~~~~~~~~~~~

Add ``twitch_auth`` to INSTALLED\_APPS

Add ``twitch_auth.backends.OAuth2Backend`` to AUTHENTICATION\_BACKENDS

Set `Twitch application`_ settings

Example using django-environ:

::

    env = environ.Env()

    TWITCH_AUTH_CLIENT_ID = env('TWITCH_CLIENT_ID', default='some_client_id')
    TWITCH_AUTH_CLIENT_SECRET = env('TWITCH_CLIENT_SECRET', default='some_client_secret')

All available settings:
^^^^^^^^^^^^^^^^^^^^^^^

TWITCH\_AUTH\_SCOPE
'''''''''''''''''''

Defines OAuth2 token scope

Defaults to ``user_read``

TWITCH\_AUTH\_PROTOCOL
''''''''''''''''''''''

Defines protocol that is used to build full authentication callback URI

Defaults to ``http://``

TWITCH\_AUTH\_CLIENT\_ID
''''''''''''''''''''''''

Defines Twitch application client ID

TWITCH\_AUTH\_CLIENT\_SECRET
''''''''''''''''''''''''''''

Defines Twitch application client secret

TWITCH\_AUTH\_REDIRECT\_URI
'''''''''''''''''''''''''''

Defines default redirect URI after successful authentication

Defaults to ``/``

Usage
-----

-  Run migrations to create database tables for entities.
-  Add somewhere in your templates link to url ``login_twitch``

.. _Django ‘sites’ framework: https://docs.djangoproject.com/en/1.11/ref/contrib/sites/
.. _Twitch application: https://www.twitch.tv/settings/connections

