Q:

Authentication for Firebase Storage when using REST API for id token

I am currently writing an app where I have used firebase authentication, but not through the firebase auth SDK, just through the following code:
void submitlogin() async {
    if (_formKey.currentState.validate()) {
      _formKey.currentState.save();
      final Map<String, dynamic> successinfo = await postdata();
      if (successinfo['success']) {
        Navigator.pushReplacement(context,
            MaterialPageRoute(builder: (BuildContext context) => BMTHome()));
      } else
        showDialog(
            context: context,
            builder: (BuildContext context) {
              return AlertDialog(
                title: Text('An error occurred!'), 
                content: Text(successinfo['message']),
                actions: <Widget>[
                  FlatButton(
                      child: Text('OK'),
                      onPressed: () {
                        Navigator.of(context).pop();
                      })
                ],
              );
            });
    }
  }

  Future<Map> fetchData() async {
    final apiresponse = await http.get(
        'https://xxx.firebaseio.com/Users/${authUser.id}.json?auth=${authUser.token}');
    //print(apiresponse.body);
    return json.decode(apiresponse.body);
  }

  Future<Map<String, dynamic>> postdata() async {
    final Map<String, dynamic> userdata = {
      'email': authenticateduser.email,
      'password': authenticateduser.password,
      'returnSecureToken': true
    };
    final http. Response response = await http.post(
        'https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyPassword?key=xxx',
        headers: {"Accept": "application/json"},
        body: json.encode(userdata));
    //print(json.decode(response.body));
    bool hasError = true;
    final Map<String, dynamic> responseData = json.decode(response.body);

    if (responseData.containsKey('idToken')) {
      hasError = false;
      message = 'Auth Succeeded';
      authUser = AuthUser(
          id: responseData['localId'],
          email: authenticateduser.email,
          token: responseData['idToken']);
    } else if (responseData['error']['message'] == 'EMAIL_NOT_FOUND') {
      hasError = true;
      message =
          'No account exists for this email address, please create an account';
          setState(() {
      isLoading = false;
    });
    } else if (responseData['error']['message'] == 'INVALID_PASSWORD') {
      hasError = true;
      message = 'Your password was incorrect';
      setState(() {
      isLoading = false;
    });
    }
    setState(() {

    });
    print(authUser.id);
    return {'success': ! hasError, 'message': message};
  }

I have this working with firebase realtime database by adding the authid to the end of the URL request for the realtime database REST API. 
The issue I am having is I also want to access firebase storage in the app and cannot find a way to access storage using the authid without using the firebase auth SDK.  Currently you have to use Google signin to use the SDK and this does not give me account information I need, hence why I am doing it like this. 
Is there anyway I can secure my storage on firebase and still pass the token to firebase storage to be able to access it? 
An example of the type of request for posting data to the realtime database is:
final http. Response response = await http.patch(
          'https://xxx.firebaseio.com/Users/${authUser.id}.json?auth=${authUser.token}',
          body: json.encode(userdatapostCode));

Currently my code for uploading images is as below, however I cannot seem to get access to storage if I secure it and I cannot find a way to pass in the authUser.token
pickercam() async {
    print('callpicker');
    File img = await ImagePicker.pickImage(source: ImageSource.camera);
    image = img;
    final String uuid = Uuid().v1();
    StorageReference reference = _storage.ref().child(uuid);
    StorageUploadTask uploadTask = reference.putFile(image);
    var dowurl = await (await uploadTask.onComplete).ref.getDownloadURL();
    print(dowurl);
    final http. Response response = await http.patch(
        'https://xxx.firebaseio.com/Users/${authUser.id}.json?auth=${authUser.token}',
        headers: {"Accept": "application/json"},
        body: json.encode({"profileurl": dowurl}));
    profileurl = dowurl;
    setState(() {});
    print('response');
  }
}

Thanks in advance

A:

In order to do this I have had to move to firebase authentication using the sdk and the firebase auth dart package using google sign in.