You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.
first of all thanks for your work on this package!
I'm trying to develop a flutter (web) application which needs to invoke access restricted Cloud Functions.
Therefore I have created a service account in my google cloud console and followed your example on how to retrieve an authenticated http client as an autonomous application.
final accountCredentials = new ServiceAccountCredentials.fromJson(r'''{ "private_key_id": "****", "private_key": "****", "client_email": "****.iam.gserviceaccount.com", "client_id": "****", "type": "service_account" }'''); var scopes = [CloudfunctionsApi.CloudPlatformScope]; AuthClient client = await clientViaServiceAccount(accountCredentials, scopes);
This seems to work fine. But when I try to use the received client to make a post request to my cloud function, I get a ClientException ("failed to parse header value").
As I understand the examples, this should work fine without specifying any headers manually in the POST function call. Correct?
However, even if I specify the header manually, I get this error.
Any help with this would be highly appreciated.
The text was updated successfully, but these errors were encountered:
I think I have found the key issue. I have to explicitly add the ID Token to the request.
However similar to this issue #52, the ID Token I receive within the client is always null.
Could any one tell me how I can retrieve a valid ID Token using this package?
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
first of all thanks for your work on this package!
I'm trying to develop a flutter (web) application which needs to invoke access restricted Cloud Functions.
Therefore I have created a service account in my google cloud console and followed your example on how to retrieve an authenticated http client as an autonomous application.
final accountCredentials = new ServiceAccountCredentials.fromJson(r'''{ "private_key_id": "****", "private_key": "****", "client_email": "****.iam.gserviceaccount.com", "client_id": "****", "type": "service_account" }'''); var scopes = [CloudfunctionsApi.CloudPlatformScope]; AuthClient client = await clientViaServiceAccount(accountCredentials, scopes);
This seems to work fine. But when I try to use the received client to make a post request to my cloud function, I get a ClientException ("failed to parse header value").
http.Response resp = await client.post( CloudFunctiontriggerURL, body: {'data': userId});
As I understand the examples, this should work fine without specifying any headers manually in the POST function call. Correct?
However, even if I specify the header manually, I get this error.
Any help with this would be highly appreciated.
The text was updated successfully, but these errors were encountered: