I'm developing a desktop application that will integrate with one or several of the Google APIs. I've done a lot of reading on the subject of OAuth 2.0, and my impression is that the spec says the client_secret
should not be required for desktop applications, where it cannot actually be kept secret. Anybody with a decompiler or the ability to inspect web requests can figure out what the secret is.
However, per https://developers.google.com/youtube/v3/guides/auth/installed-apps I attempted to send my request to receive an access
and refresh token
, but received the following 400 Bad Request
:
{
"error": "invalid_request",
"error_description": "client_secret is missing."
}
Obviously, I also tried it by adding and sending the client_secret
, which worked fine.
So, that being the case:
- Is this a bug in the API? Should this field actually not be required?
- If it is not a bug, does that mean the only proper solution is to set up an intermediary authentication server that passes along these authentication requests?
The latter seems like a ridiculous requirement to use a REST API. Though, if there are any services or projects already out there that solve this problem, I'd be much obliged to know about them. I could write something myself, but I don't want to be forced to stand up a server, set up SSL, and then write a server application for these requests.
Some of the research I did indeed took me to this post: client secret in OAuth 2.0
However, this doesn't specifically mention the API I'm attempting to use. It also doesn't cover too many workarounds. It does seem to resonate with the thoughts I've placed here, though.