{"id":19226481,"url":"https://github.com/jasonraimondi/ts-oauth2-server","last_synced_at":"2026-04-26T05:02:56.104Z","repository":{"id":37934843,"uuid":"296442659","full_name":"jasonraimondi/ts-oauth2-server","owner":"jasonraimondi","description":"A full featured, secure, standards compliant implementation of an OAuth 2.0 authorization server for Nodejs that utilizes JWT and Proof Key for Code Exchange (PKCE), written in TypeScript. ","archived":false,"fork":false,"pushed_at":"2025-03-29T03:28:53.000Z","size":4072,"stargazers_count":268,"open_issues_count":1,"forks_count":46,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-12T08:16:22.456Z","etag":null,"topics":["authorization-code-flow","authorization-server","client-credentials-flow","implicit-flow","node","node-oauth2-server","oauth2","oauth2-server","password-flow","pkce","proof-key-for-code-exchange","refresh-flow","rfc6749","rfc6750","rfc7009","rfc7519","rfc7636","rfc8693"],"latest_commit_sha":null,"homepage":"https://tsoauth2server.com/","language":"TypeScript","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/jasonraimondi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"jasonraimondi"}},"created_at":"2020-09-17T21:07:45.000Z","updated_at":"2025-04-10T10:27:22.000Z","dependencies_parsed_at":"2024-03-27T04:32:45.452Z","dependency_job_id":"9456f848-ab34-4fda-8c8c-2d253d174f53","html_url":"https://github.com/jasonraimondi/ts-oauth2-server","commit_stats":null,"previous_names":[],"tags_count":90,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasonraimondi%2Fts-oauth2-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasonraimondi%2Fts-oauth2-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasonraimondi%2Fts-oauth2-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasonraimondi%2Fts-oauth2-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jasonraimondi","download_url":"https://codeload.github.com/jasonraimondi/ts-oauth2-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254509477,"owners_count":22082892,"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":["authorization-code-flow","authorization-server","client-credentials-flow","implicit-flow","node","node-oauth2-server","oauth2","oauth2-server","password-flow","pkce","proof-key-for-code-exchange","refresh-flow","rfc6749","rfc6750","rfc7009","rfc7519","rfc7636","rfc8693"],"created_at":"2024-11-09T15:18:56.615Z","updated_at":"2026-04-26T05:02:56.093Z","avatar_url":"https://github.com/jasonraimondi.png","language":"TypeScript","funding_links":["https://github.com/sponsors/jasonraimondi"],"categories":["TypeScript"],"sub_categories":[],"readme":"# TypeScript OAuth2.0 Server\n\n[![JSR](https://jsr.io/badges/@jmondi/oauth2-server?style=flat-square)](https://jsr.io/@jmondi/oauth2-server)\n[![NPM Version](https://img.shields.io/npm/v/%40jmondi%2Foauth2-server?style=flat-square)](https://www.npmjs.com/package/@jmondi/oauth2-server)\n[![GitHub Workflow Status]( https://img.shields.io/github/actions/workflow/status/jasonraimondi/ts-oauth2-server/build-and-test.yml?branch=main\u0026style=flat-square)](https://github.com/jasonraimondi/ts-oauth2-server)\n[![Test Coverage](https://codecov.io/gh/jasonraimondi/ts-oauth2-server/branch/main/graph/badge.svg?token=F7VTS15XOJ)](https://codecov.io/gh/jasonraimondi/ts-oauth2-server)\n[![NPM Downloads](https://img.shields.io/npm/dt/@jmondi/oauth2-server?label=npm%20downloads\u0026style=flat-square)](https://www.npmjs.com/package/@jmondi/oauth2-server)\n\n`@jmondi/oauth2-server` is a standards compliant implementation of an OAuth 2.0 authorization server written in TypeScript. \n\nRequires `node \u003e= 18`. [Read the docs](https://tsoauth2server.com/)\n\nThe following RFCs are implemented:\n\n- [RFC6749 \"OAuth 2.0\"](https://tools.ietf.org/html/rfc6749)\n- [RFC6750 \"The OAuth 2.0 Authorization Framework: Bearer Token Usage\"](https://tools.ietf.org/html/rfc6750)\n- [RFC7009 \"OAuth 2.0 Token Revocation\"](https://tools.ietf.org/html/rfc7009)\n- [RFC7519 \"JSON Web Token (JWT)\"](https://tools.ietf.org/html/rfc7519)\n- [RFC7636 \"Proof Key for Code Exchange by OAuth Public Clients\"](https://tools.ietf.org/html/rfc7636)\n- [RFC7662 \"OAuth 2.0 Token Introspection\"](https://tools.ietf.org/html/rfc7662)\n- [RFC8693 \"OAuth 2.0 Token Exchange\"](https://datatracker.ietf.org/doc/html/rfc8693)\n\nOut of the box it supports the following grants:\n\n- [Authorization code grant](https://tsoauth2server.com/docs/grants/authorization_code)\n- [Client credentials grant](https://tsoauth2server.com/docs/grants/client_credentials)\n- [Refresh grant](https://tsoauth2server.com/docs/grants/refresh_token)\n- [Implicit grant](https://tsoauth2server.com/docs/grants/implicit) // not recommended \n- [Resource owner password credentials grant](https://tsoauth2server.com/docs/grants/password) // not recommended\n\nFramework support:\n\nThe included adapters are just helper functions, any framework should be supported. Take a look at the adapter implementations to learn how you can create custom adapters for your favorite tool!\n\n- [VanillaJS](https://tsoauth2server.com/docs/adapters/vanilla)\n- [Express](https://tsoauth2server.com/docs/adapters/express)\n- [Fastify](https://tsoauth2server.com/docs/adapters/fastify)\n- [H3](https://tsoauth2server.com/docs/adapters/h3)\n\n### Usage\n\nA example using client credentials grant\n\n```ts\nconst authorizationServer = new AuthorizationServer(\n  clientRepository,\n  accessTokenRepository,\n  scopeRepository,\n  \"secret-key\",\n);\nauthorizationServer.enableGrantType(\"client_credentials\");\n\napp.post(\"/token\", async (req: Express.Request, res: Express.Response) =\u003e {\n  try {\n    const oauthResponse = await authorizationServer.respondToAccessTokenRequest(req);\n    return handleExpressResponse(res, oauthResponse);\n  } catch (e) {\n    handleExpressError(e, res);\n  }\n});\n\napp.post(\"/token/revoke\", async (req: Express.Request, res: Express.Response) =\u003e {\n  try {\n    const oauthResponse = await authorizationServer.revoke(req);\n    return handleExpressResponse(res, oauthResponse);\n  } catch (e) {\n    handleExpressError(e, res);\n  }\n});\n```\n\nExample implementations:\n\n- [Simple](./example)\n- [Advanced](https://github.com/jasonraimondi/ts-oauth2-server-example)\n\n### Security\n\n| Version         | Latest Version | Security Updates |\n|-----------------|----------------|------------------|\n| [4.x][version4] | :tada:         | :tada:           |\n| [3.x][version3] | :tada:         | :tada:           |\n| [2.x][version2] |                | :tada:           |\n\n[version4]: https://github.com/jasonraimondi/ts-oauth2-server/tree/main\n[version3]: https://github.com/jasonraimondi/ts-oauth2-server/tree/3.x\n[version2]: https://github.com/jasonraimondi/ts-oauth2-server/tree/2.x\n\n## Migration Guide\n\n- [v1 to v2](https://github.com/jasonraimondi/ts-oauth2-server/releases/tag/v2.0.0)\n- [v2 to v3](https://tsoauth2server.com/docs/upgrade_guide#to-v3) \n- [v3 to v4](https://tsoauth2server.com/docs/upgrade_guide#to-v4) \n\n## Thanks\n\nThis project is inspired by the [PHP League's OAuth2 Server](https://oauth2.thephpleague.com/). Check out the [PHP League's other packages](https://thephpleague.com/#packages) for some other great PHP projects.\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=jasonraimondi/ts-oauth2-server\u0026type=Timeline)](https://star-history.com/#jasonraimondi/ts-oauth2-server\u0026Timeline)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasonraimondi%2Fts-oauth2-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjasonraimondi%2Fts-oauth2-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasonraimondi%2Fts-oauth2-server/lists"}