ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 181 - Professional Cloud Developer discussion

Report
Export

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.
Answers
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.
Answers
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.
Answers
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.
Answers
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.
Suggested answer: D

Explanation:

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.

asked 18/09/2024
Fermin Paneque Cabrera
39 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first