{"_id":"@oslojs/oauth2","_rev":"8-97a0196383192a29a4829356fb2dbc96","name":"@oslojs/oauth2","dist-tags":{"latest":"0.5.0"},"versions":{"0.1.0":{"name":"@oslojs/oauth2","version":"0.1.0","keywords":["auth","oauth2","oauth"],"author":{"name":"pilcrowOnPaper"},"license":"MIT","_id":"@oslojs/oauth2@0.1.0","maintainers":[{"name":"pilcrowonpaper","email":"pilcrowonpaper@gmail.com"}],"homepage":"https://github.com/oslo-project/oauth2#readme","bugs":{"url":"https://github.com/oslo-project/oauth2/issues"},"dist":{"shasum":"cce5b13bd119951026b0cb07e783f4938f4560cb","tarball":"https://registry.npmjs.org/@oslojs/oauth2/-/oauth2-0.1.0.tgz","fileCount":17,"integrity":"sha512-3pdqKcqRFCXLw6QyLrlsgDoEJGbjzj5WsBkqJfdyQhLFku6vZUK8TArhMQhtMPyCSKJiPWC3C5Ma98XphJY8uQ==","signatures":[{"sig":"MEUCIQCP7jRmv8YBLOdzFpf7SdVIq6nRQcCWYdwr+F9WXfhjwQIgF24EJpnnyIAun6zLwlbtHCKUTZtCkdUJOeFVkI7EzaM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":15826},"main":"dist/index.js","type":"module","_from":"file:oslojs-oauth2-0.1.0.tgz","types":"dist/index.d.ts","module":"dist/index.js","scripts":{"lint":"eslint src","build":"rm -rf dist/* && tsc --project tsconfig.build.json","format":"prettier -w ."},"_npmUser":{"name":"pilcrowonpaper","email":"pilcrowonpaper@gmail.com"},"_resolved":"/private/var/folders/qb/z2pf2nq559n552wvjqbjddww0000gn/T/0c2c159d1bf2a19719e85c1bd5380c3b/oslojs-oauth2-0.1.0.tgz","_integrity":"sha512-3pdqKcqRFCXLw6QyLrlsgDoEJGbjzj5WsBkqJfdyQhLFku6vZUK8TArhMQhtMPyCSKJiPWC3C5Ma98XphJY8uQ==","repository":{"url":"git+https://github.com/oslo-project/oauth2.git","type":"git"},"_npmVersion":"10.5.0","description":"A runtime-agnostic OAuth 2.0 library","directories":{},"_nodeVersion":"21.7.0","dependencies":{"@oslojs/crypto":"0.2.0","@oslojs/encoding":"0.2.0"},"_hasShrinkwrap":false,"devDependencies":{"auri":"^2.0.0","eslint":"^8.51.0","prettier":"^3.0.3","typescript":"^5.2.2","@types/node":"^20.8.6","@typescript-eslint/parser":"^6.7.5","@typescript-eslint/eslint-plugin":"^6.7.5"},"_npmOperationalInternal":{"tmp":"tmp/oauth2_0.1.0_1715311251209_0.9041857414107539","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.1":{"name":"@oslojs/oauth2","version":"0.1.1","keywords":["auth","oauth2","oauth"],"author":{"name":"pilcrowOnPaper"},"license":"MIT","_id":"@oslojs/oauth2@0.1.1","maintainers":[{"name":"pilcrowonpaper","email":"pilcrowonpaper@gmail.com"}],"homepage":"https://github.com/oslo-project/oauth2#readme","bugs":{"url":"https://github.com/oslo-project/oauth2/issues"},"dist":{"shasum":"e38c3fe0c0a5f79d81a669924ef9b3936c0350ae","tarball":"https://registry.npmjs.org/@oslojs/oauth2/-/oauth2-0.1.1.tgz","fileCount":17,"integrity":"sha512-TWh9evET44sHFtYz1ZPeXG8rT8Um+DUnr1GjNb/11mOEPzgAGqlu8rmTdsdqNVWqTcOkJgRyuHPYdqEv5wBn3g==","signatures":[{"sig":"MEQCIHFTXQxtdbEczHGUbELzt9tU5AgBNPj/avv/stzhNBRPAiAglwQXblg5aZYQe/XaUFwIdHaKBC+RuVB00BXoFVipaQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":15807},"main":"dist/index.js","type":"module","_from":"file:oslojs-oauth2-0.1.1.tgz","types":"dist/index.d.ts","module":"dist/index.js","scripts":{"lint":"eslint src","build":"rm -rf dist/* && tsc","format":"prettier -w ."},"_npmUser":{"name":"pilcrowonpaper","email":"pilcrowonpaper@gmail.com"},"_resolved":"/private/var/folders/qb/z2pf2nq559n552wvjqbjddww0000gn/T/87b91353fef084dff266a82c32f5bd6a/oslojs-oauth2-0.1.1.tgz","_integrity":"sha512-TWh9evET44sHFtYz1ZPeXG8rT8Um+DUnr1GjNb/11mOEPzgAGqlu8rmTdsdqNVWqTcOkJgRyuHPYdqEv5wBn3g==","repository":{"url":"git+https://github.com/oslo-project/oauth2.git","type":"git"},"_npmVersion":"10.5.0","description":"A runtime-agnostic OAuth 2.0 library","directories":{},"_nodeVersion":"21.7.0","dependencies":{"@oslojs/crypto":"0.2.0","@oslojs/encoding":"0.2.0"},"_hasShrinkwrap":false,"devDependencies":{"auri":"^2.0.0","eslint":"^8.51.0","prettier":"^3.0.3","typescript":"^5.2.2","@types/node":"^20.8.6","@typescript-eslint/parser":"^6.7.5","@typescript-eslint/eslint-plugin":"^6.7.5"},"_npmOperationalInternal":{"tmp":"tmp/oauth2_0.1.1_1717815631436_0.2891864858534292","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.2":{"name":"@oslojs/oauth2","version":"0.1.2","keywords":["auth","oauth2","oauth"],"author":{"name":"pilcrowOnPaper"},"license":"MIT","_id":"@oslojs/oauth2@0.1.2","maintainers":[{"name":"pilcrowonpaper","email":"pilcrowonpaper@gmail.com"}],"homepage":"https://github.com/oslo-project/oauth2#readme","bugs":{"url":"https://github.com/oslo-project/oauth2/issues"},"dist":{"shasum":"925d134dd0a719ce1aba70785f3204c30f9ce7de","tarball":"https://registry.npmjs.org/@oslojs/oauth2/-/oauth2-0.1.2.tgz","fileCount":17,"integrity":"sha512-snkJCDKsUwRK5+cH29qHPTg3g1Ytmsc0zn7rfSY+fjSZ1ianb84EG968xXW9QcB8JbCQtuSUb/jNjHGlXoEeqg==","signatures":[{"sig":"MEUCIQC1qcu84npVcbQEzLqQxjqPw9eR0aAr7h7ggfEvAAgzUQIgcDq71AJc8r5FeQk7E0Kw9/UDBf2N7gU6jr8g9XvH6HU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":15739},"main":"dist/index.js","type":"module","_from":"file:oslojs-oauth2-0.1.2.tgz","types":"dist/index.d.ts","module":"dist/index.js","scripts":{"lint":"eslint src","build":"rm -rf dist/* && tsc --project tsconfig.build.json","format":"prettier -w ."},"_npmUser":{"name":"pilcrowonpaper","email":"pilcrowonpaper@gmail.com"},"_resolved":"/private/var/folders/qb/z2pf2nq559n552wvjqbjddww0000gn/T/85c4869665b2cb90120b6160739a8a6d/oslojs-oauth2-0.1.2.tgz","_integrity":"sha512-snkJCDKsUwRK5+cH29qHPTg3g1Ytmsc0zn7rfSY+fjSZ1ianb84EG968xXW9QcB8JbCQtuSUb/jNjHGlXoEeqg==","repository":{"url":"git+https://github.com/oslo-project/oauth2.git","type":"git"},"_npmVersion":"10.5.0","description":"A runtime-agnostic OAuth 2.0 library","directories":{},"_nodeVersion":"21.7.0","dependencies":{"@oslojs/crypto":"0.2.0","@oslojs/encoding":"0.3.0"},"_hasShrinkwrap":false,"devDependencies":{"auri":"^2.0.0","eslint":"^8.51.0","prettier":"^3.0.3","typescript":"^5.2.2","@types/node":"^20.8.6","@typescript-eslint/parser":"^6.7.5","@typescript-eslint/eslint-plugin":"^6.7.5"},"_npmOperationalInternal":{"tmp":"tmp/oauth2_0.1.2_1717832007813_0.010587459357477957","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.2.0":{"name":"@oslojs/oauth2","version":"0.2.0","keywords":["auth","oauth2","oauth"],"author":{"name":"pilcrowOnPaper"},"license":"MIT","_id":"@oslojs/oauth2@0.2.0","homepage":"https://github.com/oslo-project/oauth2#readme","bugs":{"url":"https://github.com/oslo-project/oauth2/issues"},"dist":{"shasum":"00b34c4ea57fdf4c540c77fcb95df32ff0b55999","tarball":"https://registry.npmjs.org/@oslojs/oauth2/-/oauth2-0.2.0.tgz","fileCount":17,"integrity":"sha512-Z24BWaqBMoIQOdB4fD26A7ekRk3Hm98GHNAoX1rigDuCGwEjF9Z3MAz98M/4zyxV87mmseu2h1cJUPQhIJnPPA==","signatures":[{"sig":"MEUCIFb3eMSWLOqKK8DiJFpmc7SvqkDxeV8ys0JCW/QJ9KZ2AiEAvwS1IY1xR1nAVl3uiBjCEZOiDTqz7ykI3DIv2iB6yms=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":18390},"main":"dist/index.js","type":"module","_from":"file:oslojs-oauth2-0.2.0.tgz","types":"dist/index.d.ts","module":"dist/index.js","scripts":{"lint":"eslint src","build":"rm -rf dist/* && tsc --project tsconfig.build.json","format":"prettier -w ."},"_npmUser":{"name":"pilcrowonpaper","email":"pilcrowonpaper@gmail.com"},"_resolved":"/private/var/folders/qb/z2pf2nq559n552wvjqbjddww0000gn/T/e79ed4c91b595ca0a6c5ccf3d5a71e76/oslojs-oauth2-0.2.0.tgz","_integrity":"sha512-Z24BWaqBMoIQOdB4fD26A7ekRk3Hm98GHNAoX1rigDuCGwEjF9Z3MAz98M/4zyxV87mmseu2h1cJUPQhIJnPPA==","repository":{"url":"git+https://github.com/oslo-project/oauth2.git","type":"git"},"_npmVersion":"10.5.0","description":"A runtime-agnostic OAuth 2.0 library","directories":{},"_nodeVersion":"21.7.0","dependencies":{"@oslojs/crypto":"0.2.0","@oslojs/encoding":"0.3.0"},"_hasShrinkwrap":false,"devDependencies":{"auri":"^2.0.0","eslint":"^8.51.0","prettier":"^3.0.3","typescript":"^5.2.2","@types/node":"^20.8.6","@typescript-eslint/parser":"^6.7.5","@typescript-eslint/eslint-plugin":"^6.7.5"},"_npmOperationalInternal":{"tmp":"tmp/oauth2_0.2.0_1719404105479_0.5633064253941971","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.3.0":{"name":"@oslojs/oauth2","version":"0.3.0","keywords":["auth","oauth2","oauth"],"author":{"name":"pilcrowOnPaper"},"license":"MIT","_id":"@oslojs/oauth2@0.3.0","homepage":"https://github.com/oslo-project/oauth2#readme","bugs":{"url":"https://github.com/oslo-project/oauth2/issues"},"dist":{"shasum":"01f9bfc0484acb9e144fd2ef577056c15e9d290a","tarball":"https://registry.npmjs.org/@oslojs/oauth2/-/oauth2-0.3.0.tgz","fileCount":17,"integrity":"sha512-AR6vZP/GeH5hGMfO1OA/wMOWpiZnD91SXXHr4viYysVzn0v3kYTr78Uq+ycsrWVrv+QlExQWr3GrQ9TRLrJV+w==","signatures":[{"sig":"MEUCIGeFzzt/7Sv5UTfyDM6CVt0kz0lWNCNs22QpugKHtZSTAiEAj1S04yPoQV7zhf+3oCixvVPhvusnvbmuFaTBOjFHS3A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":18001},"main":"dist/index.js","type":"module","_from":"file:oslojs-oauth2-0.3.0.tgz","types":"dist/index.d.ts","module":"dist/index.js","scripts":{"lint":"eslint src","build":"rm -rf dist/* && tsc --project tsconfig.build.json","format":"prettier -w ."},"_npmUser":{"name":"pilcrowonpaper","email":"pilcrowonpaper@gmail.com"},"_resolved":"/private/var/folders/qb/z2pf2nq559n552wvjqbjddww0000gn/T/70c47285c320e951bb6ef71f51f25e5d/oslojs-oauth2-0.3.0.tgz","_integrity":"sha512-AR6vZP/GeH5hGMfO1OA/wMOWpiZnD91SXXHr4viYysVzn0v3kYTr78Uq+ycsrWVrv+QlExQWr3GrQ9TRLrJV+w==","repository":{"url":"git+https://github.com/oslo-project/oauth2.git","type":"git"},"_npmVersion":"10.5.0","description":"A runtime-agnostic OAuth 2.0 library","directories":{},"_nodeVersion":"21.7.0","dependencies":{"@oslojs/crypto":"0.2.0","@oslojs/encoding":"0.3.0"},"_hasShrinkwrap":false,"devDependencies":{"auri":"^2.0.0","eslint":"^8.51.0","prettier":"^3.0.3","typescript":"^5.2.2","@types/node":"^20.8.6","@typescript-eslint/parser":"^6.7.5","@typescript-eslint/eslint-plugin":"^6.7.5"},"_npmOperationalInternal":{"tmp":"tmp/oauth2_0.3.0_1719664181625_0.9406910844915322","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.4.0":{"name":"@oslojs/oauth2","version":"0.4.0","keywords":["auth","oauth2","oauth"],"author":{"name":"pilcrowOnPaper"},"license":"MIT","_id":"@oslojs/oauth2@0.4.0","maintainers":[{"name":"pilcrowonpaper","email":"pilcrowonpaper@gmail.com"}],"homepage":"https://github.com/oslo-project/oauth2#readme","bugs":{"url":"https://github.com/oslo-project/oauth2/issues"},"dist":{"shasum":"9bf4379a4233fe502c0e6ca6cd5a9fb053b87aab","tarball":"https://registry.npmjs.org/@oslojs/oauth2/-/oauth2-0.4.0.tgz","fileCount":5,"integrity":"sha512-62BdHa/mNwJqWZK9Sb8K6dkJwfsSuh0iaDgZcq9QmwDG2gvu69om3EUWNrQiuOMx34r4lCbzkZ5bQM/fhhgpSw==","signatures":[{"sig":"MEUCIQDdeiQJHjxuu7yYJPwe+198VdsRr8lSd3XFdJ1vz6VBtgIgTzyM18Knmx0wRDLMS44GtQDHmMJTqpb+hY7undvVtUs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8349},"main":"dist/index.js","type":"module","_from":"file:oslojs-oauth2-0.4.0.tgz","types":"dist/index.d.ts","module":"dist/index.js","scripts":{"lint":"eslint src","build":"rm -rf dist/* && tsc --project tsconfig.build.json","format":"prettier -w ."},"_npmUser":{"name":"pilcrowonpaper","email":"pilcrowonpaper@gmail.com"},"_resolved":"/private/var/folders/qb/z2pf2nq559n552wvjqbjddww0000gn/T/074cbd4a49e2c9e2c97fc08d63254a57/oslojs-oauth2-0.4.0.tgz","_integrity":"sha512-62BdHa/mNwJqWZK9Sb8K6dkJwfsSuh0iaDgZcq9QmwDG2gvu69om3EUWNrQiuOMx34r4lCbzkZ5bQM/fhhgpSw==","repository":{"url":"git+https://github.com/oslo-project/oauth2.git","type":"git"},"_npmVersion":"10.5.0","description":"A runtime-agnostic OAuth 2.0 library","directories":{},"_nodeVersion":"21.7.0","_hasShrinkwrap":false,"devDependencies":{"auri":"^2.0.0","eslint":"^8.51.0","prettier":"^3.0.3","typescript":"^5.2.2","@types/node":"^20.8.6","@typescript-eslint/parser":"^6.7.5","@typescript-eslint/eslint-plugin":"^6.7.5"},"_npmOperationalInternal":{"tmp":"tmp/oauth2_0.4.0_1720858776243_0.025927826133703036","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.5.0":{"name":"@oslojs/oauth2","version":"0.5.0","keywords":["auth","oauth2","oauth"],"author":{"name":"pilcrowOnPaper"},"license":"MIT","_id":"@oslojs/oauth2@0.5.0","maintainers":[{"name":"pilcrowonpaper","email":"pilcrowonpaper@gmail.com"}],"homepage":"https://github.com/oslo-project/oauth2#readme","bugs":{"url":"https://github.com/oslo-project/oauth2/issues"},"dist":{"shasum":"a794263c743cb2663ef6d140cd7c1a7be95f6fc9","tarball":"https://registry.npmjs.org/@oslojs/oauth2/-/oauth2-0.5.0.tgz","fileCount":5,"integrity":"sha512-t70+e4EgnzTbU4MrUWXzqWN2A6RJrlSSvwwuBv6E0Ap6/nsIXrjsdRWeTcSvvXTcC6fi0YdWaqEWLipcEm2Cgw==","signatures":[{"sig":"MEQCICKUQTYU36uecchrA26iKqks+LJhmNKVaJYVsbnpRYo4AiBvm6hN7hVKXR+Tfqee23M+Kk2IF7OrfJc6sUK3M6Vv3Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8325},"main":"dist/index.js","type":"module","_from":"file:oslojs-oauth2-0.5.0.tgz","types":"dist/index.d.ts","module":"dist/index.js","scripts":{"lint":"eslint src","build":"rm -rf dist/* && tsc --project tsconfig.build.json","format":"prettier -w ."},"_npmUser":{"name":"pilcrowonpaper","email":"pilcrowonpaper@gmail.com"},"_resolved":"/private/var/folders/qb/z2pf2nq559n552wvjqbjddww0000gn/T/3591eaf478f2b4c06f8caf1c3e0e7d3f/oslojs-oauth2-0.5.0.tgz","_integrity":"sha512-t70+e4EgnzTbU4MrUWXzqWN2A6RJrlSSvwwuBv6E0Ap6/nsIXrjsdRWeTcSvvXTcC6fi0YdWaqEWLipcEm2Cgw==","repository":{"url":"git+https://github.com/oslo-project/oauth2.git","type":"git"},"_npmVersion":"10.5.0","description":"A runtime-agnostic OAuth 2.0 library","directories":{},"_nodeVersion":"21.7.0","_hasShrinkwrap":false,"devDependencies":{"auri":"^2.0.0","eslint":"^8.51.0","prettier":"^3.0.3","typescript":"^5.2.2","@types/node":"^20.8.6","@typescript-eslint/parser":"^6.7.5","@typescript-eslint/eslint-plugin":"^6.7.5"},"_npmOperationalInternal":{"tmp":"tmp/oauth2_0.5.0_1720858978727_0.38058181744631026","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"time":{"created":"2024-05-10T03:20:51.076Z","modified":"2026-07-29T13:05:35.487Z","0.1.0":"2024-05-10T03:20:51.381Z","0.1.1":"2024-06-08T03:00:31.594Z","0.1.2":"2024-06-08T07:33:27.969Z","0.2.0":"2024-06-26T12:15:05.631Z","0.3.0":"2024-06-29T12:29:41.853Z","0.4.0":"2024-07-13T08:19:36.387Z","0.5.0":"2024-07-13T08:22:58.861Z"},"bugs":{"url":"https://github.com/oslo-project/oauth2/issues"},"author":{"name":"pilcrowOnPaper"},"license":"MIT","homepage":"https://github.com/oslo-project/oauth2#readme","keywords":["auth","oauth2","oauth"],"repository":{"url":"git+https://github.com/oslo-project/oauth2.git","type":"git"},"description":"A runtime-agnostic OAuth 2.0 library","maintainers":[{"name":"pilcrowonpaper","email":"pilcrowonpaper@gmail.com"}],"readme":"# @oslojs/oauth2\n\n**Documentation: https://oauth2.oslojs.dev**\n\nA small JavaScript library for parsing OAuth 2.0 token, token revocation, and device authorization responses by [Oslo](https://oslojs.dev).\n\nThis package follows [RFC 6749](https://datatracker.ietf.org/doc/html/rfc6749), [RFC 7009](https://datatracker.ietf.org/doc/html/rfc7009), and [RFC 8628](https://datatracker.ietf.org/doc/html/rfc8628).\n\n- Runtime-agnostic\n- No third-party dependencies\n- Fully typed\n\n```ts\nimport { TokenRequestResult } from \"@oslojs/oauth2\";\n\nconst response = await fetch(\"https://github.com/login/oauth/access_token\", {\n\tmethod: \"POST\",\n\tbody,\n\theaders\n});\nconst data = await response.json();\nif (typeof data !== \"object\" || data === null) {\n\tthrow new Error(\"Unexpected response\");\n}\nconst result = new TokenRequestResult(data);\nif (result.hasErrorCode()) {\n\tconst error = result.errorCode();\n\tthrow new Error(`Request failed: ${error}`);\n}\nconst accessToken = result.accessToken();\nconst accessTokenExpiresAt = result.accessTokenExpiresAt();\nconst refreshToken = result.refreshToken();\n```\n\n## Installation\n\n```\nnpm i @oslojs/oauth2\n```\n","readmeFilename":"README.md"}