exam questions

Exam Professional Cloud Developer All Questions

View all questions & answers for the Professional Cloud Developer exam

Exam Professional Cloud Developer topic 1 question 218 discussion

Actual exam question from Google's Professional Cloud Developer
Question #: 218
Topic #: 1
[All Professional Cloud Developer Questions]

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?

  • A. 1. When a user arrives at your application, prompt them for their Google username and password.
    2. Store an SHA password hash in your application's database along with the user's username.
    3. The application authenticates to the Google Cloud API using HTTPs requests with the user's username and password hash in the Authorization request header.
  • B. 1. When a user arrives at your application, prompt them for their Google username and password.
    2. Forward the user's username and password in an HTTPS request to the Google Cloud authorization server, and request an access token.
    3. The Google server validates the user's credentials and returns an access token to the application.
    4. The application uses the access token to call the Google Cloud API.
  • C. 1. When a user arrives at your application, route them to a Google Cloud consent screen with a list of requested permissions that prompts the user to sign in with SSO to their Google Account.
    2. After the user signs in and provides consent, your application receives an authorization code from a Google server.
    3. The Google server returns the authorization code to the user, which is stored in the browser's cookies.
    4. The user authenticates to the Google Cloud API using the authorization code in the cookie.
  • D. 1. When a user arrives at your application, route them to a Google Cloud consent screen with a list of requested permissions that prompts the user to sign in with SSO to their Google Account.
    2. After the user signs in and provides consent, your application receives an authorization code from a Google server.
    3. The application requests a Google Server to exchange the authorization code with an access token.
    4. The Google server responds with the access token that is used by the application to call the Google Cloud API.
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
__rajan__
3 months, 1 week ago
Selected Answer: D
D is correct.
upvoted 1 times
...
purushi
4 months, 3 weeks ago
Selected Answer: D
D is right. OAuth 2.0 authorization code grant flow is the technique to use Google APIs to access resources servers.
upvoted 1 times
...
Pime13
10 months, 2 weeks ago
Selected Answer: D
https://developers.google.com/identity/protocols/oauth2
upvoted 1 times
...
telp
11 months, 3 weeks ago
Selected Answer: D
D is the anwser You need to use OAUTH of google so A and B are eliminated. The C is using the authorization code in the cookie, it's not how it's works. So D is the correct to exchange the code for an access token.
upvoted 2 times
...
zellck
1 year ago
Selected Answer: D
D is the answer. https://developers.google.com/identity/protocols/oauth2#webserver The Google OAuth 2.0 endpoint supports web server applications that use languages and frameworks such as PHP, Java, Python, Ruby, and ASP.NET. The authorization sequence begins when your application redirects a browser to a Google URL; the URL includes query parameters that indicate the type of access being requested. Google handles the user authentication, session selection, and user consent. The result is an authorization code, which the application can exchange for an access token and a refresh token.
upvoted 1 times
...
TNT87
1 year ago
Selected Answer: D
Yes D is the answer
upvoted 1 times
...
TNT87
1 year ago
Selected Answer: D
I do agree with D
upvoted 1 times
...
kisswd
1 year ago
Selected Answer: D
https://developers.google.com/identity/protocols/oauth2
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago