mitchelltmarino / MMM-RemoteCompliments

This is a module for the open source MagicMirror² (https://github.com/MichMich/MagicMirror/) platform. MMM-RemoteCompliments provides seamless integration with Google Drive to display compliments and images on the mirror.
MIT License
22 stars 11 forks source link

Setup.js not working #10

Open thadigus opened 4 years ago

thadigus commented 4 years ago

Got through everything and put my Auth.json in the Drive folder. I ran "node Setup.js" and it returns this: Problem I assume this is a formatting issue or something of the sort. Definitely new to coding and this is the first issue I've ever submitted to GitHub so please go easy on me.

mitchelltmarino commented 4 years ago

Hi thadigus, thanks for your interest in MMM-RemoteCompliments.

You should have downloaded your credentials from Google APIs Console, renamed the file to 'Auth.json'. This file, assuming you have the correct credentials, should look like the following (perhaps without the formatting, and with actual values instead of XXX):

{
    "installed": {
        "client_id": "XXX",
        "project_id": "XXX",
        "auth_uri": "XXX",
        "token_uri": "XXX",
        "auth_provider_x509_cert_url": "XXX",
        "client_secret": "XXX",
        "redirect_uris": [
            "XXX",
            "XXX"
        ]
    }
}

I anticipate one of two issues:

  1. A formatting error is present in the JSON, so when the content is parsed on Line 35, the credentials variable is not properly initialized.

  2. Your JSON does not include the "installed" key, so when the script tries to assign "client_secret", "client_id", and "redirect_uris", it is trying to do so from a null variable. (I think this is more likely than option #1)

Please let me know if you have any other questions, or are able to provide more information on the problem!

thadigus commented 4 years ago

Hi thadigus, thanks for your interest in MMM-RemoteCompliments.

You should have downloaded your credentials from Google APIs Console, renamed the file to 'Auth.json'. This file, assuming you have the correct credentials, should look like the following (perhaps without the formatting, and with actual values instead of XXX):

{
    "installed": {
        "client_id": "XXX",
        "project_id": "XXX",
        "auth_uri": "XXX",
        "token_uri": "XXX",
        "auth_provider_x509_cert_url": "XXX",
        "client_secret": "XXX",
        "redirect_uris": [
            "XXX",
            "XXX"
        ]
    }
}

I anticipate one of two issues:

1. A formatting error is present in the JSON, so when the content is parsed on Line 35, the credentials variable is not properly initialized.

2. Your JSON does not include the "installed" key, so when the script tries to assign "client_secret", "client_id", and "redirect_uris", it is trying to do so from a null variable. (I think this is more likely than option #1)

Please let me know if you have any other questions, or are able to provide more information on the problem!

Yes the second of which is the problem. It says "web" instead of "installed" but I changed that and filled in all of the new things. New problem is the redirect_uris. What values should those be? Should those be a localhost on some port or what? Thank you so much for responding to me!

mitchelltmarino commented 4 years ago

Are you sure you're downloading the correct credentials file? You need to go to Google APIs developer console, then click "credentials" on the side bar.

I just tried downloading my pre-existing credentials last night and I've been getting a credentials JSON file in the correct format. In my credentials.json, one of the URIs is a localhost string, and the other is some sort of [URN](https://en.wikipedia.org/wiki/Uniform_Resource_Name#:~:text=A%20Uniform%20Resource%20Name%20(URN,that%20uses%20the%20urn%20scheme.).

It may help me troubleshoot if you tell me the format of your credentials file.

Please let me know if this helps, and if you are having any other issues / need help trouble shooting further. Thanks!

machonacho007 commented 4 years ago

Is this still supported? The google api and credential process seems to have changed quite a bit. There is no longer a way to get "other" for the type. I tried creating a web type and trying to edit the Auth.json from web to installed, but other issues prevent the setup from running. Thanks

machonacho007 commented 4 years ago

Using an app type of Desktop seems to work

corvusdeinanis commented 3 years ago

Using an app type of Desktop seems to work

Thanks for this!

Is it working for you though? Doesn't seem to work for me. Nothing, not even the header appears.