PROFESSIONAL-CLOUD-DEVELOPER · Question #151
You developed a JavaScript web application that needs to access Google Drive's API and obtain permission from users to store files in their Google Drives. You need to select an authorization approach
The correct answer is D. Create an OAuth Client ID.. When a web application needs to access Google APIs (like Google Drive) on behalf of individual users and must obtain their explicit permission (consent) to do so, OAuth 2.0 is the required authorization framework. Creating an OAuth 2.0 Client ID registers the application with Goo
Question
You developed a JavaScript web application that needs to access Google Drive's API and obtain permission from users to store files in their Google Drives. You need to select an authorization approach for your application. What should you do?
Options
- ACreate an API key.
- BCreate a SAML token.
- CCreate a service account.
- DCreate an OAuth Client ID.
How the community answered
(42 responses)- A5% (2)
- B12% (5)
- C2% (1)
- D81% (34)
Explanation
When a web application needs to access Google APIs (like Google Drive) on behalf of individual users and must obtain their explicit permission (consent) to do so, OAuth 2.0 is the required authorization framework. Creating an OAuth 2.0 Client ID registers the application with Google's OAuth server, enabling the standard OAuth consent flow where users are redirected to a Google login/consent page, grant specific permissions (scopes), and the app receives an access token. Option A (API key) identifies the application but does not represent user identity or grant user-delegated permissions - it cannot be used for user data access. Option B (SAML token) is for federated identity/single sign-on between identity providers, not for API authorization. Option C (service account) is for server-to-server authentication where no user is involved - a service account acts as its own identity and cannot request permissions on behalf of a user.
Topics
Community Discussion
No community discussion yet for this question.