{ "info": { "author": ": Rohit Jose", "author_email": ": rohitjose@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Framework :: Django :: 2.0", "Framework :: Django :: 2.1", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "django_lti_auth\n===============\n\n.. image:: https://img.shields.io/pypi/pyversions/django_lti_auth.svg\n :target: https://pypi.python.org/pypi/django_lti_auth\n\n.. image:: https://img.shields.io/pypi/v/django_lti_auth.svg\n :target: https://pypi.python.org/pypi/django_lti_auth\n :alt: Latest PyPI version\n\n.. image:: https://img.shields.io/pypi/dm/django_lti_auth.svg\n :target: https://pypi.python.org/pypi/django_lti_auth\n\nThis project aims to provide a dead simple way to integrate LTI Authentication into your Django powered app. Try it now, and get rid of the complicated configuration of LTI.\n\nUsage\n-----\n1. Set up the app as an LTI tool on Moodle. You need to specify the following:\n\n a. Secure Tool URL:\n\n .. image:: secure_tool_url.png\n :width: 200px\n :align: center\n :height: 100px\n :alt: Secure Tool URL\n\n b. Consumer key and Shared secret:\n\n .. image:: consumer_key.png\n :width: 200px\n :align: center\n :height: 100px\n :alt: Consumer Key and Secret\n\n2. Import the views module in your root **urls.py**\n\n .. code-block:: python\n\n # this is main urls.py for the project\n from django.conf.urls import url, include\n\n urlpatterns += [\n url(r'^lti/', include('django_lti_auth.urls')),\n ...\n ]\n\n3. In settings.py, add the LTI related configuration.\n\n .. code-block:: python\n\n PYLTI_CONFIG = {\n \"consumers\": {\n \"\": {\n \"secret\": \"\"\n }\n },\n \"method_hooks\":{\n \"valid_lti_request\":\"\",\n \"invalid_lti_request\":\"\"\n },\n \"next_url\":\"\"\n }\n\n4. You also need to add the following settings into your settings.py file.\n\n .. code-block:: python\n\n X_FRAME_OPTIONS = 'ALLOW-FROM https://moodle.telt.unsw.edu.au/'\n SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')\n SECURE_SSL_REDIRECT = False\n SESSION_COOKIE_SECURE = True\n CSRF_COOKIE_SECURE = True\n\n5. Add 'django_lti_auth' to INSTALLED_APPS\n\n .. code-block:: python\n\n INSTALLED_APPS = [\n '...',\n 'django_lti_auth',\n ]\n\nExplanation\n------------\n* **valid_lti_request** - The module calls the method you specify here after validating the LTI payload if the payload is valid. The method passes the LTI payload values extracted into a python dictionary as an argument to this method. You can use this payload to bind the user variables to the session. \n\n .. code-block:: python\n\n def valid_lti_request(user_payload, request):\n ...\n request.session['userid'] = user_payload['user_id'] \n request.session['roles'] = user_payload['roles']\n request.session['context_id'] = user_payload['context_id']\n ...\n\n You can return a URL value in case you want to redirect the LTI authenticated user to a new URL after the LTI Authentication.\n\n .. code-block:: python\n\n def valid_lti_request(user_payload, request):\n ...\n url = reverse('', kwargs={'context': user_payload['context_id'], 'userid':user_payload['user_id']})\n return url\n\n\n* **invalid_lti_request** - This method is called after validation when the LTI payload is invalid. You can use this method to redirect the user back to the login page (or an access denied page).\n\nInstallation\n------------\n\nTo install the package run the following command:\n\n.. code-block:: python\n\n pip install django-lti-auth\n\n\nRequirements\n^^^^^^^^^^^^\n.. code-block:: python\n\n PyLTI==0.5.1\n\nLicence\n-------\nMIT license\n\nAuthors\n-------\n\n`django_lti_auth` was written by `Rohit Jose `_.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/rohitjose/django-lti-auth.git", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-lti-auth", "package_url": "https://pypi.org/project/django-lti-auth/", "platform": "", "project_url": "https://pypi.org/project/django-lti-auth/", "project_urls": { "Homepage": "https://github.com/rohitjose/django-lti-auth.git" }, "release_url": "https://pypi.org/project/django-lti-auth/1.0.0/", "requires_dist": [ "PyLTI (==0.5.1)" ], "requires_python": "", "summary": "Django LTI Authentication Made Easy. Easily integrate with your LTI provider for django projects", "version": "1.0.0" }, "last_serial": 4480282, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "de6740b4d764795fe6876176a119d88b", "sha256": "5518977c3f6db1552ff5214f4ca8c1eb2060438fbf322bc7e9d0beafa254b860" }, "downloads": -1, "filename": "django_lti_auth-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "de6740b4d764795fe6876176a119d88b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5570, "upload_time": "2018-11-13T04:07:54", "url": "https://files.pythonhosted.org/packages/fc/0d/4ffadc998e704edfb2e64dd9a8fc2f7ce74a1003264b9df3139d07245055/django_lti_auth-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f9403a0e79ca7139f59ee493e4cad21d", "sha256": "30bd74f233f96b2e2e6ecaca43eecf7c0e1a4e4e69f741c92a80dc68b0c1743a" }, "downloads": -1, "filename": "django_lti_auth-1.0.0.tar.gz", "has_sig": false, "md5_digest": "f9403a0e79ca7139f59ee493e4cad21d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30993, "upload_time": "2018-11-13T04:07:57", "url": "https://files.pythonhosted.org/packages/5d/a4/8716cc18e4905cc89fe7b25525a68e1e9c48ab192945f209c3513ae01493/django_lti_auth-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "de6740b4d764795fe6876176a119d88b", "sha256": "5518977c3f6db1552ff5214f4ca8c1eb2060438fbf322bc7e9d0beafa254b860" }, "downloads": -1, "filename": "django_lti_auth-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "de6740b4d764795fe6876176a119d88b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5570, "upload_time": "2018-11-13T04:07:54", "url": "https://files.pythonhosted.org/packages/fc/0d/4ffadc998e704edfb2e64dd9a8fc2f7ce74a1003264b9df3139d07245055/django_lti_auth-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f9403a0e79ca7139f59ee493e4cad21d", "sha256": "30bd74f233f96b2e2e6ecaca43eecf7c0e1a4e4e69f741c92a80dc68b0c1743a" }, "downloads": -1, "filename": "django_lti_auth-1.0.0.tar.gz", "has_sig": false, "md5_digest": "f9403a0e79ca7139f59ee493e4cad21d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30993, "upload_time": "2018-11-13T04:07:57", "url": "https://files.pythonhosted.org/packages/5d/a4/8716cc18e4905cc89fe7b25525a68e1e9c48ab192945f209c3513ae01493/django_lti_auth-1.0.0.tar.gz" } ] }