top of page

How to get Client ID and Client Secret in Google Cloud Platform




Here are the steps one should follow to get Google App Client Id, Client Secret and Bucket Name from Google Cloud Platform:

  • If you are already registered on Google developer account, you will see a screen as shown below. Click on “Select a project” on the top header bar.


  • From the project selection pop up click on the “New Project” button to add a new project.


  • Enter your “Project Name” and click on the “Create” button. You can also edit your Project ID if you want to.


  • Click on ‘OAuth Consent Screen’ by hovering the mouse on ‘APIs & Services’ from the left side menu.


  • On “OAuth Consent Screen”, choose User Type as per your requirement and click on Create button to process further.


  • Add Application Name, select Support Email, add Authorized Domain and Developer Content Information. Then click on the Save and continue button.





  • After completing all 3 steps in OAuth Content Screen, click on Back to Dashboard on Summary Step.


  • After creating the project, click on “Credentials” from the left side menu to open the Credentials screen, click on “Create Credentials” and from the dropdown list select OAuth client Id.


On OAuth client Id creation screen

  1. Select the “Web Application” from the “Application Type” dropdown.

  2. Enter your OAuth 2.0 client name in the “Name” field. This name will not be shown to end users when they are asked to give login permission to your website.

  3. Enter your catalog site URL in “Authorized JavaScript origins”. For example, if website domain is xyz.com, enter http://xyz.com

  4. In the “Authorized redirect URIs” input box, enter your website URL + the page/end-point where you wanted your user redirected back. If you are using Microsoft.Owin.Security.Google library, the end-point is “/signin-google”. For example, my website url is http://xyz.com, so I enter http://xyz.com/signin-google

  5. Click on “Create” Button.


Note: Use System.Url.getOrgDomainUrl().toExternalForm() in your apex method to get the redirect URIs and paste it to the Authorized redirect URIs input box.



  • It will display a pop-up with Client Id and Client Secret.


  • Create a storage bucket. Click on the navigation button, then click on Storage and then click on Browser.


  • On the Storage’s Browser screen, click on Create Bucket.


If you have previously created buckets or deployed web apps, you will see the Strorage's Browser screen with a list of your existing buckets similar to the following screen. Click the CREATE BUCKET option.



  • On the Create a bucket screen, enter your bucket's name (for example, cs4750db-demo). The bucket serves as your root folder; i.e., the main context directory of your web app / website. Click continue. You may need to click Choose where to store your data to expand the option. Select Regional for Location type, and select us-east4 for Location; then click the Create button.



  • You may access the bucket from the browser screen. Copy the name of the bucket.

“Now just save the Client Id, Client Secret and Bucket name. You can save it on any custom object or if it is not required then just copy it on any txt file.”

Once you are done with the above steps, now we will guide you to generate the access token with the help of Google OAuth 2.0 endpoint. Please click the below button


Comments


bottom of page