5

according to google:

The older Google Sign-In platform library: apis.google.com/js/platform.js, and Google APIs client library for JavaScript: gapi.client, are no longer required for user authentication and authorization. They have been replaced by a single new Google Identity Services JavaScript library: accounts.google.com/gsi/client.

with the older library you could both authenticate users to your site and you could make authorized requests to google api such as calendar.

there is no information in the docs, as far as i can see, reagrding how to make authenticated requests to google api's such as calendar.

is the new api only replacing the old for apps that only do sign in. am i missing a way of using the new api to make authenicated requests.

user2897377
  • 163
  • 1
  • 9
  • 2
    I have the exact same question. I'd like my users to be able to sign into my app via Google, _and_ I need to authorize server-side access to the Google Calendar API. Before, this was possible via `grantOfflineAccess()` and scopes, but the [migration guide for the new Identity Services](https://developers.google.com/identity/gsi/web/guides/migration) has no "after" option for those features and simply says, "Remove. An ID token has replaced OAuth2 access tokens and scopes." – Dave Feldman Sep 29 '21 at 15:59
  • i think this answer answers the question, [link](https://stackoverflow.com/questions/68815693/how-to-use-scoped-apis-with-gsi-google-identity-services). basically saying google have not implemented the authorization part of the new api yet. – user2897377 Sep 30 '21 at 18:46
  • Right. For now, only authentication is supported by the new GIS JS library. Authorization typically requires an access token to call Google APIs, while authentication requires only an JWT ID token to identify a user account. Authentication and authorization have been split into separate flows, and currently only the authentication-only flow is being asked to migrate... and has a clearly documented path for migration from the old to new SDK. Stay tuned, however. This is an excellent question and observation which will soon have a more concrete answer. – bdid Oct 01 '21 at 17:30
  • the question i link to gives a good answer if true but offers no reference. you are basically saying the same thing. your profile says you work for google. can i ask, are you speaking for google in your answer or just aggreeing that logically what the answer says makes sense. – user2897377 Oct 11 '21 at 07:12
  • 1
    Does this answer your question? [How to use scoped APIs with (GSI) Google Identity Services](https://stackoverflow.com/questions/68815693/how-to-use-scoped-apis-with-gsi-google-identity-services) – John Jul 25 '22 at 19:40

1 Answers1

2

FYI: On Feb/15/2022, Google announced the availability of Authorization in Google Identify Service SDK:

https://developers.googleblog.com/2022/02/announcing-authorization-support-for.html

here is the docs:

https://developers.google.com/identity/oauth2/web/guides/overview

bezalel
  • 36
  • 4