Authentication - Signup with Google
Closed this issue · 2 comments
Narrative
As a user of Interactive Diary
I want to sign up to Interactive Diary using my Google account
So that I can sync my Google account with Interactive Diary
Scenarios
Scenario 1
GIVEN my Google account is ready
AND internet connection is available
WHEN I launch the app
THEN app is launched in anonymous mode
AND Authentication button is available
Scenario 2
GIVEN scenario 1
WHEN I click on Authentication button
THEN I'll be presented with option to sign up with Google Account
Scenario 3
GIVEN scenario 2
WHEN I tap on Sign up with Google Account
THEN I'll be taken to Google Sign In
Scenario 4
GIVEN scenario 2
WHEN I successfully sign up using my Google Account
THEN I'll be navigated to Interactive Diary home screen
Scenario 5
GIVEN scenario 3
WHEN I failed to sign up using my Google Account
THEN I'll be taken back to Sign up screen
AND there will be error message to inform me about the failure
Scenario 5
GIVEN my Google account is ready
AND internet connection is unavailable
WHEN I launch the app
THEN app is launched in anonymous mode
AND Authentication button is not presented
Technical requirement
These technical requirement are to be implemented in code
Packages - Authentication service
- Authentication service needs to be implemented as part of packages, and will be included to the main project through pubspec.yaml
- use package google_sign_in
- Separate REVERSED_CLIENT_ID between debug and release build
- REVERSED_CLIENT_ID needs to be hidden in the code, and only available through CI/CD process
- Need to update Wiki to add guideline how to enable REVERSED_CLIENT_ID in local development
- Strings are to be used in localisation
@suesitran Hi suesitran, i have some questions below.
- How can we hide REVERSED_CLIENT_ID in dart code ?
- Techniques that i knew was using --dart-define or .env file.
- Update : i'm following this article, But i don't understand how does it works.
- What is the difference between the technique in article and --dart-define | .env ? Is it more secure ?
- Then how can we get that key/id and use it inside flutter code ? Example : Get api key and add to http client header.