{"id":22572171,"url":"https://github.com/alexmngn/react-native-authentication","last_synced_at":"2025-04-05T23:08:20.766Z","repository":{"id":69428320,"uuid":"72909810","full_name":"alexmngn/react-native-authentication","owner":"alexmngn","description":null,"archived":false,"fork":false,"pushed_at":"2018-03-01T12:02:55.000Z","size":515,"stargazers_count":494,"open_issues_count":5,"forks_count":159,"subscribers_count":20,"default_branch":"master","last_synced_at":"2024-04-15T15:56:45.334Z","etag":null,"topics":["authentification","nodejs","react","react-native","sailsjs"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexmngn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-05T06:40:55.000Z","updated_at":"2024-02-13T15:38:58.000Z","dependencies_parsed_at":"2023-05-07T12:17:38.093Z","dependency_job_id":null,"html_url":"https://github.com/alexmngn/react-native-authentication","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexmngn%2Freact-native-authentication","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexmngn%2Freact-native-authentication/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexmngn%2Freact-native-authentication/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexmngn%2Freact-native-authentication/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexmngn","download_url":"https://codeload.github.com/alexmngn/react-native-authentication/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247411234,"owners_count":20934653,"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":["authentification","nodejs","react","react-native","sailsjs"],"created_at":"2024-12-08T02:08:23.254Z","updated_at":"2025-04-05T23:08:20.747Z","avatar_url":"https://github.com/alexmngn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-authentication\n\nThe main goal of this project is to show you how to register and authenticate a user and access protected resources from a React-Native app to a NodeJS server.\n\nIf you want to know more about this project, you can read this article which describe how it works:\n\nThe Essential Boilerplate to Authenticate Users on your React-Native app.\u003cbr /\u003e\nhttps://medium.com/@alexmngn/the-essential-boilerplate-to-authenticate-users-on-your-react-native-app-f7a8e0e04a42\n\nThis project has been tested with Node v6.0.0 and NPM 3.8.6.\n\n## Client\n\n### Installation\n\nIf you don't have React-Native installed on your computer, run the following:\n```\nnpm install -g react-native-cli\n```\n\nGo in the `client/MobileApp` directory, and run the following:\n\n```\nnpm install\n```\n\n### Run\n\niOS:\n```\nreact-native run-ios\n```\nAndroid:\n\nYou will need to follow a few steps to run the client:\n\n- Open the file `client/MobileApp/src/services/api/config.js`\n- Modify `localhost` with the IP address of your machine (usually something like 192.168.0.10)\n```\nexport default {\n\tclientId: '8puWuJWZYls1Ylawxm6CMiYREhsGGSyw',\n\turl: 'http://192.168.0.10:1337',\n};\n```\n- Create a file called `local.properties` in the `/MobileApp/android` folder and add the following line (replace the target with the path to your SDK): `sdk.dir = /Users/Alexis/Library/Android/sdk`\n- Open an Emulator (from Android Studio) or plug an Android device on your computer.\n- Then you can run the following in terminal:\n```\nreact-native run-android\n```\n\n### Use\n\nYou can login with the following user:\n- Email: **user1@facebook.com**\n- Password: **12345678**\n\nThere is also a Client-ID that has already been generated, currently hard-coded in the client api config:\n- **8puWuJWZYls1Ylawxm6CMiYREhsGGSyw**\n\n\n## Server\n\n### Installation\n\n\nIf you don't have SailsJS installed on your computer, run the following:\n```\nnpm install -g sails\n```\n\nGo in the `server` directory, then run the following:\n\n```\nnpm install\n```\n\n### Run\n\nRun the following in the terminal:\n\n```\nsails lift\n```\n\nThis will create a server listening on port 3000, you can access it from http://localhost:3000/. The server needs to run at all time when you use the client.\n\n### Entry-points:\n\nAn open entry-point is provided to generate this ID. This should not be done in production:\n\n- `POST /clients`\n\nThe non-protected entry-points allow authentication and registration:\n\n- `POST /users`: Create a new user\n- `POST /users/auth`: Authenticate and retrieve the access and refresh tokens in exchange of email/password\n- `POST /users/auth/refresh`: Authenticate and retrieve the access token in exchange of the refresh token.\n\nThe protected entry-point allows everything else:\n- `GET /users`: Retrieve the list of users\n- `POST /users/auth/revoke`: Log out, revoke access by destroying the user tokens\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexmngn%2Freact-native-authentication","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexmngn%2Freact-native-authentication","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexmngn%2Freact-native-authentication/lists"}