{"repo":"bhubr/react-simple-oauth2-login","free":true,"listed":false,"github":"https://github.com/bhubr/react-simple-oauth2-login","clone":"git clone https://github.com/bhubr/react-simple-oauth2-login.git","description":"Simple React component for OAuth2 login - Supports Authorization Code and Implicit Grant flows.","language":"JavaScript","stars":53,"topics":["oauth2","react"],"license":"MIT","category":"auth-billing-email","readme_excerpt":"React Simple OAuth2 Login :trophy: Credits : this component is based on React GitHub Login by Checkr. Simple React component for OAuth2 login. Supports Authorization Code and Implicit Grant flows. RTFM Usage Basic example Example app Props ChangeLog Usage Basic example The component displays as a simple button. Clicking it will open the authorization screen for your chosen provider, in a popup (thus avoiding losing your app's state). Four props are mandatory: authorizationUrl , responseType , clientId , redirectUri . The client ID is given by the OAuth2 provider (usually along with a client secret) when you set up an OAuth2 app (where you're asked to fill in the Redirect URI). Example app Check out the examples in the example directory. You'll need OAuth2 apps configured on whatever provider. Client app Setup: cd example/client npm install Copy settings.sample.js as settings-code.js and/or settings-implicit.js , depending on which flow you intend to test. npm start (uses Parcel) The client app provides examples for both flows. If you look at the two components, what really distinguishes how they use the component is: The value of responseType prop, The fetch call to send the code to the server in the Authorization Code example. Server app The server app is only given as an example to test the Authorization Code flow . It currently supports getting access tokens from GitHub or Spotify. In a real-world app, you'll probably want to use Passport. Right after you run npm install ,","default_branch":null,"files":null,"tree":[],"storefront":"/r/bhubr","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/bhubr/react-simple-oauth2-login/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."}