Google Cloud Professional Cloud Developer — Question 157

You are developing a Java Web Server that needs to interact with Google Cloud services via the Google Cloud API on the user's behalf. Users should be able to authenticate to the Google Cloud API using their Google Cloud identities. Which workflow should you implement in your web application?

Answer options

Correct answer: D

Explanation

Option D is correct because it outlines the proper OAuth 2.0 flow for user authentication, which involves obtaining an authorization code and then exchanging it for an access token. Options A and B incorrectly require handling user credentials directly, which is not secure or compliant with best practices. Option C does not finalize the process with the exchange for an access token, making it incomplete for accessing the Google Cloud API.