{"id":15419163,"url":"https://github.com/mattmazzola/react-simple-auth","last_synced_at":"2025-04-19T14:52:08.470Z","repository":{"id":57344617,"uuid":"106953331","full_name":"mattmazzola/react-simple-auth","owner":"mattmazzola","description":"Authentication library for React based on Ember-Simple-Auth","archived":false,"fork":false,"pushed_at":"2020-01-10T10:10:49.000Z","size":232,"stargazers_count":56,"open_issues_count":4,"forks_count":14,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-29T08:51:12.769Z","etag":null,"topics":["authentication","oauth2","openid-connect","react","typescript"],"latest_commit_sha":null,"homepage":null,"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/mattmazzola.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"code-of-conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-14T18:40:54.000Z","updated_at":"2023-01-02T15:27:14.000Z","dependencies_parsed_at":"2022-09-11T09:01:20.184Z","dependency_job_id":null,"html_url":"https://github.com/mattmazzola/react-simple-auth","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattmazzola%2Freact-simple-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattmazzola%2Freact-simple-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattmazzola%2Freact-simple-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattmazzola%2Freact-simple-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattmazzola","download_url":"https://codeload.github.com/mattmazzola/react-simple-auth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249717914,"owners_count":21315075,"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":["authentication","oauth2","openid-connect","react","typescript"],"created_at":"2024-10-01T17:24:21.439Z","updated_at":"2025-04-19T14:52:08.443Z","avatar_url":"https://github.com/mattmazzola.png","language":"TypeScript","funding_links":["https://paypal.me/AJoverMorales"],"categories":[],"sub_categories":[],"readme":"# React-Simple-Auth\n\n[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Greenkeeper badge](https://badges.greenkeeper.io/alexjoverm/typescript-library-starter.svg)](https://greenkeeper.io/)\n[![Travis](https://img.shields.io/travis/alexjoverm/typescript-library-starter.svg)](https://travis-ci.org/alexjoverm/typescript-library-starter)\n[![Coveralls](https://img.shields.io/coveralls/alexjoverm/typescript-library-starter.svg)](https://coveralls.io/github/alexjoverm/typescript-library-starter)\n[![Dev Dependencies](https://david-dm.org/alexjoverm/typescript-library-starter/dev-status.svg)](https://david-dm.org/alexjoverm/typescript-library-starter?type=dev)\n[![Donate](https://img.shields.io/badge/donate-paypal-blue.svg)](https://paypal.me/AJoverMorales)\n\n# Simple Authentication for React\n\n## Resources\n\n- Detailed Walkthrough: \\\nhttps://medium.com/p/de6ea9df0a63\n\n- Video demonstration: \\\nhttps://www.youtube.com/watch?v=BEUrlvHY8eE\n\n- Sample Application using react-simple-auth: \\\nhttps://github.com/mattmazzola/react-simple-auth-sample\n\nTechnical Docs: \\\nhttps://mattmazzola.github.io/react-simple-auth/\n\n# Getting started\n\n## Installation\n```bash\nnpm i react-simple-auth\n```\n## Copy [redirect.html](https://github.com/mattmazzola/react-simple-auth/blob/master/static/redirect.html)\nCopy file from `/node_modules/react-simple-auth/dist/redirect.html` into folder that will service static files. E.g. If you are using create-react-app this will be the `public` folder.  Ensure your OAuth provider is configured to redirect to this html page instead of your normal application / index page.\n\n## Create a provider\nYou would have to look at each OAuth provider's developer documentation for details.\n\nCreate a javascript object implementing the `IProvider` interface.\n\nSee the sample for Microsoft AAD v2 OpenID-Connect from the sample project: \\\nhttps://github.com/mattmazzola/react-simple-auth-sample/blob/master/src/providers/microsoft.ts\n\nBased on these docs: \\\nhttps://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-v2-protocols\n\n## Call the various methods from the auth service\n\nImport:\n```typescript\nimport RSA from 'react-simple-auth'\nimport facebookProvider from './providers/facebook'\n```\n\nSomewhere inside the component:\n```typescript\n// Open login window and wait for user to sign in\nconst session = await RSA.acquireTokenAsync(facebookProvider)\n\n// Invoke Redux login action dispatcher\nlogin(session.userId, session.userName)\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattmazzola%2Freact-simple-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattmazzola%2Freact-simple-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattmazzola%2Freact-simple-auth/lists"}