{"repo":"badgateway/oauth2-client","free":true,"listed":false,"github":"https://github.com/badgateway/oauth2-client","clone":"git clone https://github.com/badgateway/oauth2-client.git","description":"OAuth2 client for Node and browsers","language":"TypeScript","stars":337,"topics":["oauth2","oauth","typescript","fetch","middleware","hacktoberfest"],"license":"MIT","category":"auth-billing-email","readme_excerpt":"OAuth2 client for Node and browsers This package contains an OAuth2 client. It aims to be a fully-featured OAuth2 utility library, for Node.js, Browsers and written in Typescript. This OAuth2 client is only 4KB gzipped, it has 0 dependencies and relies on modern APIs like fetch() and [Web Crypto][4] which are built-in since Node 18. Highlights 16KB minified (5KB gzipped). No dependencies. authorization code grant with optional [PKCE][1] support. password and client credentials grant. a fetch() wrapper that automatically adds Bearer tokens and refreshes them. OAuth2 endpoint discovery via the Server metadata document ([RFC8414][2]). OAuth2 Token Introspection ([RFC7662][3]). Resource Indicators for OAuth 2.0 ([RFC8707][5]). OAuth2 Token Revocation ([RFC7009][6]). OAuth 2.0 Multiple Response Type Encoding Practices Installation Usage To get started, set up the Client class. Tokens Many functions use or return a 'OAuth2Token' type. This type has the following shape: client credentials grant. Refreshing tokens password grant: authorization code The authorization code flow is the flow for browser-based applications, and roughly consists of 3 major steps: 1. Redirect the user to an authorization endpoint, where they log in. 2. Authorization endpoint redirects back to app with a 'code' query parameter. 3. The code is exchanged for a access and refresh token. This library provides support for these steps, but there's no requirement to use its functionality as the system is mostly sta","default_branch":null,"files":null,"tree":[],"storefront":"/r/badgateway","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/badgateway/oauth2-client/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}