{"id":27286594,"url":"https://github.com/udibo/oauth2_server","last_synced_at":"2025-04-11T19:43:24.187Z","repository":{"id":41316048,"uuid":"343267377","full_name":"udibo/oauth2_server","owner":"udibo","description":"A standards compliant implementation of an OAuth 2.0 authorization server with PKCE support.","archived":false,"fork":false,"pushed_at":"2022-04-04T00:00:17.000Z","size":570,"stargazers_count":21,"open_issues_count":14,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-04T18:55:03.982Z","etag":null,"topics":["deno","javascript","oak","oauth2","oauth2-server","typescript"],"latest_commit_sha":null,"homepage":"","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/udibo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-01T02:29:56.000Z","updated_at":"2024-09-20T09:48:41.000Z","dependencies_parsed_at":"2022-09-26T18:11:57.405Z","dependency_job_id":null,"html_url":"https://github.com/udibo/oauth2_server","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udibo%2Foauth2_server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udibo%2Foauth2_server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udibo%2Foauth2_server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udibo%2Foauth2_server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/udibo","download_url":"https://codeload.github.com/udibo/oauth2_server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248225781,"owners_count":21068078,"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":["deno","javascript","oak","oauth2","oauth2-server","typescript"],"created_at":"2025-04-11T19:43:23.650Z","updated_at":"2025-04-11T19:43:24.165Z","avatar_url":"https://github.com/udibo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OAuth2 Server\n\n[![version](https://img.shields.io/badge/release-0.12.0-success)](https://deno.land/x/oauth2_server@0.12.0)\n[![deno doc](https://doc.deno.land/badge.svg)](https://doc.deno.land/https/deno.land/x/oauth2_server@0.12.0/authorization_server.ts)\n[![CI](https://github.com/udibo/oauth2_server/workflows/CI/badge.svg)](https://github.com/udibo/oauth2_server/actions?query=workflow%3ACI)\n[![codecov](https://codecov.io/gh/udibo/oauth2_server/branch/main/graph/badge.svg?token=8Q7TSUFWUY)](https://codecov.io/gh/udibo/oauth2_server)\n[![license](https://img.shields.io/github/license/udibo/oauth2_server)](https://github.com/udibo/oauth2_server/blob/master/LICENSE)\n\nA standards compliant implementation of an OAuth 2.0 authorization server with\nPKCE support.\n\nThis module was inspired by\n[node-oauth2-server](https://github.com/oauthjs/node-oauth2-server).\n\n## Features\n\n- The OAuth 2.0 Authorization Framework\n  [RFC 6749](https://datatracker.ietf.org/doc/html/rfc6749) compliant\n- The OAuth 2.0 Authorization Framework: Bearer Token Usage\n  [RFC 6750](https://datatracker.ietf.org/doc/html/rfc6750) compliant\n- Proof Key for Code Exchange by OAuth Public Clients\n  [RFC 7636](https://datatracker.ietf.org/doc/html/rfc7636) compliant\n- Follows best security practices from\n  [RFC 6819](https://datatracker.ietf.org/doc/html/rfc6819) and\n  [OAuth 2.0 Security Best Current\n  Practice](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-security-topics)\n- Framework agnostic with officially supported adapter for\n  [Oak](https://deno.land/x/oak)\n\n## Installation\n\nTo include this module in a Deno project, you can import directly from the TS\nfiles. This module is available in Deno's third part module registry but can\nalso be imported directly from GitHub using raw content URLs.\n\nThere are 2 different main entry points for this module.\n\n- [authorization_server.ts](authorization_server.ts)\n- [resource_server.ts](resource_server.ts)\n\nThe ResourceServer provides methods for authenticating requests and verifying\nthe request has proper authorization. You should use this if your server is not\nalso acting as an authorization server.\n\n```ts\n// Import from Deno's third party module registry\nimport { ResourceServer } from \"https://deno.land/x/oauth2_server@0.12.0/resource_server.ts\";\n// Import from GitHub\nimport { ResourceServer } from \"https://raw.githubusercontent.com/udibo/oauth2_server/0.12.0/resource_server.ts\";\n```\n\nThe AuthorizationServer is an extension of the ResourceServer, adding methods\nused by the authorize and token endpoints.\n\n```ts\n// Import from Deno's third party module registry\nimport { AuthorizationServer } from \"https://deno.land/x/oauth2_server@0.12.0/authorization_server.ts\";\n// Import from GitHub\nimport { AuthorizationServer } from \"https://raw.githubusercontent.com/udibo/oauth2_server/0.12.0/authorization_server.ts\";\n```\n\n## Usage\n\nAn example of how to use this module can be found\n[here](examples/oak-localstorage). I wouldn't recommend using the example as is\nbut it should give you an idea of how to use this module.\n\nSee\n[deno docs](https://doc.deno.land/https/deno.land/x/oauth2_server@0.12.0/authorization_server.ts)\nfor more information.\n\n### Grants\n\nThis module comes with the authorization code, client credentials, and refresh\ntoken grant types. The authorization code grant supports PKCE but does not\nrequire it.\n\nAn implementation of the resource owner password credentials grant can be found\n[here](grants/password.ts) but is not included in mod.ts because the grant type\ninsecurely exposes the credentials of the resource owner to the client. See\n[OAuth 2.0 Security Best Current\nPractice](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-security-topics#section-2.4)\nfor more information.\n\nThe implicit grant was not implemented because it is vulnerable to access token\nleakage and access token replay. You should use the authorization code grant\ninstead. See\n[OAuth 2.0 Security Best Current\nPractice](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-security-topics#section-2.1.2)\nfor more information.\n\n#### Extension Grants\n\nWhen implemented, extension grants will be added to the same folder as the other\ngrant types and added to this readme.\n\n### Models\n\nThe [models folder](models) contains interfaces for objects used by this module.\nYou can extend the models how you want.\n\n### Services\n\nThe [services folder](services) contains abstract classes and interfaces for\nobjects used by this module to get and store models.\n\nThe [oak-localstorage](examples/oak-localstorage) example shows how to use\nlocalStorage for your services. The example includes some functions that are not\nrequired by this module. Some of the functions in the example don't need to be\nasync since localStorage is syncronous but were made asyncronous to make it easy\nto replace localStorage with something else that is asyncronous.\n\n### Adapters\n\nThis module is framework agnostic. Adapters can be created to make this\ncompatible with any framework. It comes with an adapter for\n[Oak](https://deno.land/x/oak).\n\nIf you would like to use this module with other frameworks, look at the oak\nadapter for an example of how to implement an adapter.\n\nThe oak adapter can be found [here](adapters/oak). A working example showing how\nto use this module with the adapter can be found\n[here](examples/oak-localstorage).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fudibo%2Foauth2_server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fudibo%2Foauth2_server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fudibo%2Foauth2_server/lists"}