Open kevmoo opened 9 years ago
Shouldn't this not throw an error at all? I thought we didn't need to provide a secret when using a serviceAccount, am I wrong?
I feel like
Future<AccessCredentials> obtainAccessCredentialsUsingCode(
ClientId clientId, String code, String redirectUrl, http.Client client,
[List<String> scopes]) {
var uri = Uri.parse('https://accounts.google.com/o/oauth2/token');
var formValues = [
'grant_type=authorization_code',
'code=${Uri.encodeQueryComponent(code)}',
'redirect_uri=${Uri.encodeQueryComponent(redirectUrl)}',
'client_id=${Uri.encodeQueryComponent(clientId.identifier)}',
'client_secret=${Uri.encodeQueryComponent(clientId.secret)}',
];
// ....
should do a null check for clientId.secret
before encoding it.
The URL encoding fails with a an unhelpful error because the ClientId has a
null
secret.