{"id":22173247,"url":"https://github.com/digao-dalpiaz/reactnativeauth","last_synced_at":"2025-03-24T17:45:26.168Z","repository":{"id":223074290,"uuid":"759252857","full_name":"digao-dalpiaz/ReactNativeAuth","owner":"digao-dalpiaz","description":"React Native app with OAuth2","archived":false,"fork":false,"pushed_at":"2024-02-27T01:46:09.000Z","size":10859,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-29T22:32:50.524Z","etag":null,"topics":["auth","fusionauth","login","mobile","oauth2","react-native"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/digao-dalpiaz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-02-18T04:08:46.000Z","updated_at":"2024-05-18T21:46:10.000Z","dependencies_parsed_at":"2024-12-02T07:41:45.174Z","dependency_job_id":null,"html_url":"https://github.com/digao-dalpiaz/ReactNativeAuth","commit_stats":null,"previous_names":["digao-dalpiaz/reactnativeauth"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digao-dalpiaz%2FReactNativeAuth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digao-dalpiaz%2FReactNativeAuth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digao-dalpiaz%2FReactNativeAuth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digao-dalpiaz%2FReactNativeAuth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/digao-dalpiaz","download_url":"https://codeload.github.com/digao-dalpiaz/ReactNativeAuth/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245320398,"owners_count":20596173,"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":["auth","fusionauth","login","mobile","oauth2","react-native"],"created_at":"2024-12-02T07:31:28.222Z","updated_at":"2025-03-24T17:45:26.144Z","avatar_url":"https://github.com/digao-dalpiaz.png","language":"JavaScript","readme":"# ReactNativeAuth\nReact Native app with OAuth2 using FusionAuth\n\nhttps://github.com/digao-dalpiaz/ReactNativeAuth/assets/46692097/87e0f412-0876-4422-80d5-6e13baafbf01\n\nStack:\n- Database: MySql 8\n- Frontend: React Native with Expo\n- Backend: .NET Core 8\n- Auth: FusionAuth\n\n## How to setup the environment\n\n**Requirements:**\n\n- Node\n- .NET Core 8 SDK\n- FusionAuth Server\n- Docker (optional, but recommended)\n- Expo Go for Mobile (optional, if debugging in mobile)\n\n### FusionAuth\n\nI recommend you to use Docker. Download an image of FusionAuth app and run it.\n\n*FusionAuth requires its own database, supporting PostgreSQL and MySQL. You need to configure database connection settings when running first time.*\n\nThe default FusionAuth port is 9011.\n\nSteps in FusionAuth admin:\n\n1. Create an Key Master for JWT token (Settings \u003e Key Master \u003e use Generate HMAC secret in the top-right menu)\n2. Create an application, set Client Authentication to \"Not required\", set Authorized redirect URLs (you can run app once and get this url from error when trying to login).\n3. Enable JWT in app and configure Access token signing key to use the Key Master.\n4. Create an API Key.\n5. Enabled \"Generate refresh tokens\" in Application \u003e Security.\n\nOptional: Configure the Issuer in Tenant. The default is \"acme.com\", but you may change this. The JWT validation in backend is based on Issuer, App ID and Key Master secret.\n\n### MySql Database\n\nInstall MySql Server 8 and create a new empty database.\n\n### Mobile App\n\nCreate a \".env\" file in \"app\" folder:\n\n```\nEXPO_PUBLIC_AUTH_CLIENT_ID={the app id in FusionAuth}\nEXPO_PUBLIC_AUTH_URL=http://fusionauth_host:9011\nEXPO_PUBLIC_BACKEND_URL=http://backend_host:5258\n```\n\nRun \"npm install\"\n\nRun \"npm expo start\" \n\n### Backend (.NET Core 8)\n\nCreate a \"appsettings.Development.json\" in \"backend\" folder:\n\n```json\n{\n  \"Logging\": {\n    \"LogLevel\": {\n      \"Default\": \"Information\",\n      \"Microsoft.AspNetCore\": \"Warning\"\n    }\n  },\n  \"DB_STRING\": \"Server=host;Database=database_name;Uid=user;Pwd=password\",\n  \"AUTH_URL\": \"http://fusionauth_host:9011\",\n  \"AUTH_API_KEY\": \"{FusionAuth api key}\",\n  \"AUTH_ISSUER\": \"acme.com\",\n  \"AUTH_APP_ID\": \"{the app id in FusionAuth}\",\n  \"AUTH_SECRET\": \"{the Master Key secret in FusionAuth}\"\n}\n```\n\nRun application service.\n\n\u003e To run in your phone, install Expo Go app.\n\n**Remember to allow backend and Node in your firewall if running in your phone.**\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigao-dalpiaz%2Freactnativeauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdigao-dalpiaz%2Freactnativeauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigao-dalpiaz%2Freactnativeauth/lists"}