{"id":14974214,"url":"https://github.com/darkanthey/oauth2-stateless","last_synced_at":"2025-08-26T23:36:17.350Z","repository":{"id":57447534,"uuid":"118016435","full_name":"darkanthey/oauth2-stateless","owner":"darkanthey","description":"OAuth 2.0 provider written in python. Can work without database.","archived":false,"fork":false,"pushed_at":"2023-04-26T12:27:32.000Z","size":110,"stargazers_count":19,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-05T09:48:11.087Z","etag":null,"topics":["aiohttp","flask","oauth2","oauth2-server","python","stateless","tornado","wsgi"],"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/darkanthey.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-18T17:40:32.000Z","updated_at":"2023-08-27T17:01:56.000Z","dependencies_parsed_at":"2024-09-23T15:01:00.035Z","dependency_job_id":null,"html_url":"https://github.com/darkanthey/oauth2-stateless","commit_stats":{"total_commits":18,"total_committers":2,"mean_commits":9.0,"dds":"0.16666666666666663","last_synced_commit":"fea3c0a3eca4bf4874f16dcabf2a1b3e9c80cfb0"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/darkanthey/oauth2-stateless","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkanthey%2Foauth2-stateless","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkanthey%2Foauth2-stateless/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkanthey%2Foauth2-stateless/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkanthey%2Foauth2-stateless/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/darkanthey","download_url":"https://codeload.github.com/darkanthey/oauth2-stateless/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkanthey%2Foauth2-stateless/sbom","scorecard":{"id":322608,"data":{"date":"2025-08-11","repo":{"name":"github.com/darkanthey/oauth2-stateless","commit":"fea3c0a3eca4bf4874f16dcabf2a1b3e9c80cfb0"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/18 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"27 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2023-120 / GHSA-45c4-8wx5-qw6w","Warn: Project is vulnerable to: GHSA-5m98-qgg9-wh84","Warn: Project is vulnerable to: GHSA-7gpw-8wmc-pm8g","Warn: Project is vulnerable to: GHSA-8495-4g3g-x7pr","Warn: Project is vulnerable to: PYSEC-2024-26 / GHSA-8qpw-xqxj-h4r2","Warn: Project is vulnerable to: GHSA-9548-qrrj-x5pj","Warn: Project is vulnerable to: PYSEC-2023-246 / GHSA-gfw2-4jvh-wgfg","Warn: Project is vulnerable to: GHSA-pjjw-qhg8-p2p9","Warn: Project is vulnerable to: PYSEC-2023-250 / GHSA-q3qx-c6g2-7pw2","Warn: Project is vulnerable to: PYSEC-2023-251 / GHSA-qvrw-v9rv-5rjx","Warn: Project is vulnerable to: PYSEC-2021-76 / GHSA-v6wp-4m6f-gcjg","Warn: Project is vulnerable to: PYSEC-2023-247 / GHSA-xx9p-xxvh-7g8j","Warn: Project is vulnerable to: PYSEC-2018-66 / GHSA-562c-5r94-xh97","Warn: Project is vulnerable to: PYSEC-2019-179 / GHSA-5wv5-4vpf-pj6m","Warn: Project is vulnerable to: PYSEC-2023-62 / GHSA-m2qf-hxjv-5gpq","Warn: Project is vulnerable to: GHSA-m87m-mmvp-v9qm","Warn: Project is vulnerable to: PYSEC-2013-30 / GHSA-x33v-f3gp-gw2c","Warn: Project is vulnerable to: GHSA-753j-mpmx-qq6g","Warn: Project is vulnerable to: GHSA-7cx3-6m66-7c5m","Warn: Project is vulnerable to: PYSEC-2020-213 / GHSA-8vpw-mgpf-mpvv","Warn: Project is vulnerable to: GHSA-8w49-h785-mj3c","Warn: Project is vulnerable to: PYSEC-2012-5 / GHSA-f7fv-v9rh-prvc","Warn: Project is vulnerable to: PYSEC-2023-75 / GHSA-hj3f-6gcp-jg8j","Warn: Project is vulnerable to: GHSA-qppv-j76h-2rpx","Warn: Project is vulnerable to: GHSA-w235-7p84-xx57","Warn: Project is vulnerable to: GHSA-fm67-cv37-96ff","Warn: Project is vulnerable to: GHSA-wpqr-jcpx-745r"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T01:44:46.047Z","repository_id":57447534,"created_at":"2025-08-18T01:44:46.047Z","updated_at":"2025-08-18T01:44:46.047Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272267449,"owners_count":24903691,"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","status":"online","status_checked_at":"2025-08-26T02:00:07.904Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["aiohttp","flask","oauth2","oauth2-server","python","stateless","tornado","wsgi"],"created_at":"2024-09-24T13:50:10.541Z","updated_at":"2025-08-26T23:36:17.321Z","avatar_url":"https://github.com/darkanthey.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Oauth2-stateless\n\nOauth2-stateless is a framework that aims at making it easy to provide authentication\nvia [OAuth 2.0](http://tools.ietf.org/html/rfc6749) within an application stack.\nMain difference of this library is the simplicity\nand the ability to work without any database just with 'stateless'\ntokens based on **JWT** [JSON Web Tokens](https://en.wikipedia.org/wiki/JSON_Web_Token).\n\n[Documentation](http://oauth2-stateless.readthedocs.org/en/latest/index.html)\n\n\n# Status\n\n[![Travis Build Status][build-badge]][build]\n[![License](http://img.shields.io/badge/Licence-MIT-brightgreen.svg)](LICENSE)\n\nOauth2-stateless has reached its beta phase. All main parts of the [OAuth 2.0 RFC](http://tools.ietf.org/html/rfc6749) such as the various types of Grants, Refresh Token and Scopes have been implemented.\n\n\n# Installation\n\noauth2-stateless is [available on PyPI](http://pypi.python.org/pypi/oauth2-stateless/)\n\n``` bash\npip install oauth2-stateless\n```\n\n\n# Usage\n\n## Example Authorization server\n\n``` python\n    from wsgiref.simple_server import make_server\n    import oauth2\n    import oauth2.grant\n    import oauth2.error\n    from oauth2.store.memory import ClientStore\n    from oauth2.store.stateless import Token Store\n    import oauth2.tokengenerator\n    import oauth2.web.wsgi\n\n\n    # Create a SiteAdapter to interact with the user.\n    # This can be used to display confirmation dialogs and the like.\n    class ExampleSiteAdapter(oauth2.web.AuthorizationCodeGrantSiteAdapter, oauth2.web.ImplicitGrantSiteAdapter):\n        TEMPLATE = '''\n    \u003chtml\u003e\n        \u003cbody\u003e\n            \u003cp\u003e\n                \u003ca href=\"{url}\u0026confirm=confirm\"\u003econfirm\u003c/a\u003e\n            \u003c/p\u003e\n            \u003cp\u003e\n                \u003ca href=\"{url}\u0026deny=deny\"\u003edeny\u003c/a\u003e\n            \u003c/p\u003e\n        \u003c/body\u003e\n    \u003c/html\u003e'''\n\n        def authenticate(self, request, environ, scopes, client):\n            # Check if the user has granted access\n            example_user_id = 123\n            example_ext_data = {}\n\n            if request.post_param(\"confirm\") == \"confirm\":\n                return example_ext_data, example_user_id\n\n            raise oauth2.error.UserNotAuthenticated\n\n        def render_auth_page(self, request, response, environ, scopes, client):\n            url = request.path + \"?\" + request.query_string\n            response.body = self.TEMPLATE.format(url=url)\n            return response\n\n        def user_has_denied_access(self, request):\n            # Check if the user has denied access\n            if request.post_param(\"deny\") == \"deny\":\n                return True\n            return False\n\n    # Create an in-memory storage to store your client apps.\n    client_store = ClientStore()\n    # Add a client\n    client_store.add_client(client_id=\"abc\", client_secret=\"xyz\", redirect_uris=[\"http://localhost/callback\"])\n\n    site_adapter = ExampleSiteAdapter()\n\n    # Create an in-memory storage to store issued tokens.\n    # LocalTokenStore can store access and auth tokens\n    stateless_token = oauth2.tokengenerator.StatelessTokenGenerator(secret_key='xxx')\n    token_store = TokenStore(stateless)\n\n    # Create the controller.\n    provider = oauth2.Provider(\n        access_token_store=token_store,\n        auth_code_store=token_store,\n        client_store=client_store,\n        token_generator=stateless_token)\n    )\n\n    # Add Grants you want to support\n    provider.add_grant(oauth2.grant.AuthorizationCodeGrant(site_adapter=site_adapter))\n    provider.add_grant(oauth2.grant.ImplicitGrant(site_adapter=site_adapter))\n\n    # Add refresh token capability and set expiration time of access tokens to 30 days\n    provider.add_grant(oauth2.grant.RefreshToken(expires_in=2592000))\n\n    # Wrap the controller with the Wsgi adapter\n    app = oauth2.web.wsgi.Application(provider=provider)\n\n    if __name__ == \"__main__\":\n        httpd = make_server('', 8080, app)\n        httpd.serve_forever()\n```\n\nThis example only shows how to instantiate the server.\nIt is not a working example as a client app is missing.\nTake a look at the [examples](docs/examples/) directory.\n\nOr just run this example:\n\n``` bash\npython docs/examples/stateless_client_server.py\n```\n\nThis is already a workable example. They can work without database\nbecause oauth token already contain all the necessary information like\na user_id, grant_type, data, scopes and client_id.\nIf you want to check user state like a ban, disable, etc.\nYou can check this param on server site from database. By adding this check to\n/api/me or redefine oauth2.tokengenerator and add specific logic.\n\n\n# Supported storage backends\n\nOauth2-stateless does not force you to use a specific database or you\ncan work without database with stateless token.\n\nIt currently supports these storage backends out-of-the-box:\n\n- MongoDB\n- MySQL\n- Redis\n- Memcached\n- Dynamodb\n\nHowever, you are not not bound to these implementations.\nBy adhering to the interface defined by the base classes in **oauth2.store**,\nyou can easily add an implementation of your backend.\nIt also is possible to mix different backends and e.g. read data of a client\nfrom MongoDB while saving all tokens in memcached for fast access.\n\nTake a look at the examples in the [examples](docs/examples/) directory of the project.\n\n\n# Site adapter\n\n- aiohttp\n- flask\n- tornado\n- uwsgi\n\nLike for storage, oauth2-stateless does not define how you identify a\nuser or show a confirmation dialogue.\nInstead your application should use the API defined by _oauth2.web.SiteAdapter_.\n\n\n# Contributors\n\n[\u003cimg alt=\"DarkAnthey\" src=\"https://avatars2.githubusercontent.com/u/200977?v=3\u0026s=117\" width=\"117\"\u003e](https://github.com/darkanthey) |\n:---:\n|[DarkAnthey](https://github.com/darkanthey)|\n\n[build-badge]: https://travis-ci.org/darkanthey/oauth2-stateless.svg?branch=master\n[build]: https://travis-ci.org/darkanthey/oauth2-stateless.svg?branch=master\n[license-badge]: https://img.shields.io/badge/license-MIT-blue.svg?style=flat\n[license]: https://github.com/darkanthey/oauth2-stateless/blob/master/LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkanthey%2Foauth2-stateless","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarkanthey%2Foauth2-stateless","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkanthey%2Foauth2-stateless/lists"}