Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Getting the unlimited token for YouTube API

Hello there!

Our company has Google Workspace (we pay for it). Also we made our own app that works with YouTube API. This app currently is in “Testing” state — which means that its’ token is only valid for 7 days.

I have read in the documentation that a token can be without time limits if:

  1. The app type is “Internal” — hence, it is used only by internal users;
  2. The app type is “External” and it has successfully passed moderation as an app for external users.

My app is intended as “Internal” — only for users who work in my company. So I chose the “Internal” type for it. But when I use OAuth, I get an error:

App is restricted to users within its organization. If you think you should have access, you can contact the developer. Learn more about this error

Untitled.png

If I get this right, the system “believes” that a YouTube channel (which is created inside the organization) belongs to a user who is not a member of this said organization.

I suspect that because when you create a channel, a user with random email also is created. In our case:

Untitled (1).png

Here comes the fun part: I do not have access to this newly generated email. Meaning I have no idea how to solve this problem.

So my two questions are:

  1. Do I understand the cause of this problem correctly? If so, how do I solve it?
  2. Are there any alternative solutions for elongating a token's lifespan?

2 3 4,475
3 REPLIES 3