{"id":13453443,"url":"https://github.com/Bearle/django-scatter-auth","last_synced_at":"2025-03-24T01:31:30.134Z","repository":{"id":49695238,"uuid":"143552823","full_name":"Bearle/django-scatter-auth","owner":"Bearle","description":"Django Scatter Auth for EOS blockchain","archived":false,"fork":false,"pushed_at":"2022-12-26T20:38:11.000Z","size":1282,"stargazers_count":17,"open_issues_count":4,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-14T04:51:11.284Z","etag":null,"topics":["blockchain","django","eos","eosio","package","scatter","scatter-wallet"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Bearle.png","metadata":{"files":{"readme":"README.rst","changelog":"HISTORY.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-04T18:27:02.000Z","updated_at":"2022-07-21T23:46:00.000Z","dependencies_parsed_at":"2023-01-31T01:30:58.672Z","dependency_job_id":null,"html_url":"https://github.com/Bearle/django-scatter-auth","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bearle%2Fdjango-scatter-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bearle%2Fdjango-scatter-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bearle%2Fdjango-scatter-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bearle%2Fdjango-scatter-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bearle","download_url":"https://codeload.github.com/Bearle/django-scatter-auth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245194233,"owners_count":20575726,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","django","eos","eosio","package","scatter","scatter-wallet"],"created_at":"2024-07-31T08:00:40.110Z","updated_at":"2025-03-24T01:31:28.842Z","avatar_url":"https://github.com/Bearle.png","language":"Python","funding_links":[],"categories":["Language Support"],"sub_categories":["Python"],"readme":"=============================\ndjango-scatter-auth\n=============================\n\n.. image:: https://badge.fury.io/py/django-scatter-auth.svg\n    :target: https://badge.fury.io/py/django-scatter-auth\n\n.. image:: https://travis-ci.org/Bearle/django-scatter-auth.svg?branch=master\n    :target: https://travis-ci.org/Bearle/django-scatter-auth\n\n.. image:: https://codecov.io/gh/Bearle/django-scatter-auth/branch/master/graph/badge.svg\n    :target: https://codecov.io/gh/Bearle/django-scatter-auth\n\ndjango-scatter-auth is a pluggable Django app that enables login/signup via Scatter (EOS extension wallet). The user authenticates themselves by digitally signing the hostname with their wallet's private key.\n\n.. image:: https://github.com/Bearle/django-scatter-auth/blob/master/docs/_static/django_scatter_auth_test2.gif?raw=true\n\nDocumentation\n-------------\n\nThe full documentation is at https://django-scatter-auth.readthedocs.io.\n\nExample project\n---------------\n\nhttps://github.com/Bearle/django-scatter-auth/tree/master/example\n\nYou can check out our example project by cloning the repo and heading into example/ directory.\nThere is a README file for you to check, also.\n\n\nFeatures\n--------\n\n* Scatter API login, signup\n* Scatter Django forms for signup, login\n* Checks signature (validation)\n* Uses hostname signing as proof of private key posession\n* Easy to set up and use (just one click)\n* Custom auth backend\n* VERY customizable - uses Django settings, allows for custom User model\n* Vanilla Javascript helpers included\n\nQuickstart\n----------\nInstall django-scatter-auth with pip::\n\n    pip install django-scatter-auth\n\nAdd it to your `INSTALLED_APPS`:\n\n.. code-block:: python\n\n    INSTALLED_APPS = (\n        ...\n        'scatterauth.apps.scatterauthConfig',\n        ...\n    )\n\nSet `'scatterauth.backend.ScatterAuthBackend'` as your authentication backend:\n\n.. code-block:: python\n\n    AUTHENTICATION_BACKENDS = [\n    'django.contrib.auth.backends.ModelBackend',\n    'scatterauth.backend.ScatterAuthBackend'\n    ]\n\n\nSet your User model's field to use as public key storage:\n\n.. code-block:: python\n\n    SCATTERAUTH_USER_PUBKEY_FIELD = 'username'\n\nAnd if you have some other fields you want to be in the SignupForm, add them too:\n\n.. code-block:: python\n\n    SCATTERAUTH_USER_SIGNUP_FIELDS = ['email',]\n\n\nAdd django-scatter-auth's URL patterns:\n\n.. code-block:: python\n\n    from scatterauth import urls as scatterauth_urls\n\n\n    urlpatterns = [\n        ...\n        url(r'^', include(scatterauth_urls)),\n        ...\n    ]\n\nAdd some javascript to handle login:\n\n\n.. code-block:: html\n\n    \u003cscript src=\"{% static 'scatterauth/js/scatterauth.js' %}\"\u003e\u003c/script\u003e\n\n\n.. code-block:: javascript\n\n    var login_url = '{% url 'scatterauth_login_api' %}';\n    document.addEventListener('scatterLoaded', scatterExtension =\u003e {\n      console.log('scatter loaded');\n      if (scatter.identity) {\n        console.log(\"Identity found\");\n        loginWithAuthenticate(login_url,console.log,console.log,console.log,console.log, function (resp) {\n          window.location.replace(resp.redirect_url);\n        });\n      } else {\n        console.log('identity not found, have to signup');\n      }\n    });\n\nYou can access signup using {% url 'scatterauth_signup' %} and API signup using {% url 'scatterauth_signup_api' %}.\n\nIf you have any questions left, head to the example app https://github.com/Bearle/django-scatter-auth/tree/master/example\n\n\n\nImportant details and FAQ\n-------------------------\n\n1. *If you set a custom public key field (SCATTERAUTH_USER_PUBKEY_FIELD), it MUST be unique (unique=True).*\n\nThis is needed because if it's not, the user can register a new account with the same public key as the other one,\nmeaning that the user can now login as any of those accounts (sometimes being the wrong one).\n\n2. *How do i deal with user passwords or Password is not set*\n\nThere should be some code in your project that generates a password using ``User.objects.make_random_password`` and sends it to a user email.\nOr, even better, sends them a 'restore password' link.\nAlso, it's possible to copy signup_view to your project, assign it a url, and add the corresponding lines to set some password for a user.\n\n3. *Why don't i have to sign a message? It's needed in django-web3-auth, how this app is secure?*\n\nThis app uses scatter's ``authenticate`` function to handle message signing - hostname being the signed message.\nThis means that the user \u0026 the client share knowledge of the original message and the server can verify\nclient's possession of the private key corresponding to the public key.\n\n\nRunning Tests\n-------------\n\nDoes the code actually work?\n\n::\n\n    source \u003cYOURVIRTUALENV\u003e/bin/activate\n    (myenv) $ pip install tox\n    (myenv) $ tox\n\nCredits\n-------\n\nTools used in rendering this package:\n\n*  Cookiecutter_\n*  `cookiecutter-djangopackage`_\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`cookiecutter-djangopackage`: https://github.com/pydanny/cookiecutter-djangopackage\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBearle%2Fdjango-scatter-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBearle%2Fdjango-scatter-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBearle%2Fdjango-scatter-auth/lists"}