Auth0 is Authentication/Authorisation as a service and has a free tier offering which will be suffice for our needs.
- Register an account at https://auth0.com/
- Create a new API https://auth0.com/docs/apis
- Name: gogo-garage-opener
- Identifier: https://<YOUR_GARAGE_DOOR_DOMAIN>
- Signing Algorithm: RS256
- Create a react native application https://auth0.com/docs/quickstart/native/react-native/00-login
- Name: gogo-garage-opener-app
- Type: Native
- Allowed Callback URLs: uk.echosoft.garage.opener://<YOUR_AUTH0_DOMAIN>/android/uk.echosoft.garage.opener/callback
- Install https://play.google.com/store/apps/details?id=uk.echosoft.garage.opener
- Update settings
- Garage Opener Domain: This should be set to the RS/<YOUR_GARAGE_DOOR_DOMAIN>. The domain pointing to the Raspberry pi
- Auth0 Domain: This should be set to the AS/<YOUR_AUTH0_DOMAIN>
- Client ID: This should be set to the client ID found in Auth0 under your react native application
- Auth0 API Audience: This should be set to the API Audience found on the API page in Auth0
This rule allows you to use a social login for convenience but still lock down to specific users.
- Go to Rules
- Create Rule
- Empty Rule
- Copy and paste allowed-emails.js into the code block and save