Let's say the OAuth login using implicit flow works just fine, and an additional scope was requested successfully as well (as seen in the popup which asks for Drive permissions in this example):
Now after lots of digging and running into errors, I'm so incredibly confused with Google's deprecation of (parts of?) their JavaScript client libraries for browsers. I understood that the Google API Client Library for JavaScript is not deprecated, but only its authentication part. And since the latest react-oauth library loads the newer alternative, things should be fine. Nevertheless, when trying the client library as follows
gapi.load('client', () => {
gapi.client
.init({
clientId: googleOauthClientId,
scope: 'https://www.googleapis.com/auth/drive.readonly',
})
.then(() => {
// ...Make request using the retrieved `tokenResponse.access_token` from above - but we don't even get here...
})
.catch((e) => console.error(e));
});
I get this hard deprecation error in the catch clause:
You have created a new client application that uses libraries for user authentication or authorization that are deprecated. New clients must use the new libraries instead. See the Migration Guide for more information.
Any idea how to integrate actual API requests into a web app without using server-side requests? Adding an example would be very helpful for developers since Google really doesn't keep their documentation for JavaScript stuff clear and up to date.
Let's say the OAuth login using implicit flow works just fine, and an additional scope was requested successfully as well (as seen in the popup which asks for Drive permissions in this example):
Now after lots of digging and running into errors, I'm so incredibly confused with Google's deprecation of (parts of?) their JavaScript client libraries for browsers. I understood that the Google API Client Library for JavaScript is not deprecated, but only its authentication part. And since the latest
react-oauth
library loads the newer alternative, things should be fine. Nevertheless, when trying the client library as followsI get this hard deprecation error in the
catch
clause:Any idea how to integrate actual API requests into a web app without using server-side requests? Adding an example would be very helpful for developers since Google really doesn't keep their documentation for JavaScript stuff clear and up to date.