I'm working on a flutter app for a client.
This involves uploading files to a Google drive folder.
I've got it working with the Google sign in pop-up, but they want it so that the account used is separated from the device accounts.
Is this possible?
I don't think service accounts are right because they still want the email and password to be set in the app settings, and from what I understand service accounts need to be made and linked directly in the API console.
EDIT: here's my current code for logging in with the Google sign-in plugin;
static final GoogleSignIn _googleSignIn = GoogleSignIn(
scopes: [
g.DriveApi.DriveScope,
g.DriveApi.DriveMetadataReadonlyScope
]
);
static dynamic token;
...
static login() async{
try {
final GoogleSignInAccount googleUser = await _googleSignIn.signIn();
final GoogleSignInAuthentication googleAuth = await googleUser
.authentication;
print("signed in " + googleAuth.accessToken);
token = googleAuth.accessToken;
_authHeaders = await _googleSignIn.currentUser.authHeaders;
}catch(exception){
//maybe offline
print("login error: "+exception.toString());
}
}
So is it possible to use email and password instead of this method (which show's an account selection pop-up)?