migueesc123 / YoutubeAnalytics

A Microsoft Data Connector or Power Query Connector for YoutubeAnalytics data
MIT License
61 stars 21 forks source link

Forbidden access issue #37

Closed migueesc123 closed 4 years ago

migueesc123 commented 4 years ago

Dear Miguel, Great many thanks for this connector! I managed to make it work and connect to our YouTube channel, I saw the data, all fine. Then I refreshed and the connection seems to have broken. Even is I try with a new file it doesn't work. I get the error message "Expression.Error: Access to the resource is forbidden." Any idea what went wrong? Many thanks for your feedback in advance! Source_access

Originally posted by @nemessj in https://github.com/migueesc123/YoutubeAnalytics/issues/36#issuecomment-593949641

migueesc123 commented 4 years ago

Hey!

This has to do with the permissions or scopes given to the authenticated user. In other words, is not related to the connector itself, but to the app that you’ve created on the google api console and the authenticated user.

I highly encourage you to check your app permissions and make sure that the user that you’re using to Authenticate has all the correct accesses to the data as well as the app has all the correct scopes.

nemessj commented 4 years ago

Hi Miguel, Many thanks for the quick response. Indeed. The problem comes from the fact that our TY channel is not associated to a @gmail.com address. Because of this when I used the connector it didn't recognised the email address I was trying to connect with (with which I created the credentials on https://console.developers.google.com/). To bridge this I added a gmail address as manager of the YT channel and created the credentials for that. Recreated the json file and the rest. But it still does't work. Now the error I get is "[Expression.Error] The field 'redirect_uris' of the record wasn't found.". Is there any way I can solve this issue? Any way of using the original email that is associated to the YT channel? Many thanks!

migueesc123 commented 4 years ago

The Custom Connector handles the calls to the API, but the whole authentication and permissions aspect of it is handled at your application level, meaning that it is completely up to your setup at the application level on how permissions, scopes and such will behave.

When I developed this connector, I tested it against a few YouTube channels. Some of them had a gmail account associated to them, and some others perhaps had a google account under a different email address such as a hotmail one, but they all worked without any issues. The error that you're getting seems to be because your application doesn't have the redirect_uri in place, so you'll need to make the changes to your application.

I wish that I could tell you more, but I don't have access to your environment, nor can I debug the errors that you're getting.

I do offer my services if you need help setting this up, require any customizations to the custom connector code or simply require help with Power BI in general. In case you're interested, you can contact me via email info@poweredsolutions.co