3

How do I register an Apps Script project and get the Client Secret for oAuth, and set the callback URL?

3
  • 1
    This is more of a development oriented question; you are more likely to get an answer at Stack Overflow
    – user79865
    Dec 31 '15 at 4:54
  • 2
    I figured out the answer after posting the question. As long as the question is not considered to be breaking the rules here, I may leave it and answer it myself. If that's okay. This question would be considered "to broad" on stackoverflow, and be criticized for not being a question with a code example. This question has nothing to do with writing code, so it doesn't technically fit at stackoverflow. And I was promptly told that Apps Script questions were considered off topic at SuperUser.
    – Alan Wells
    Dec 31 '15 at 5:00
  • 1
    Sure, please do add the answer then.
    – user79865
    Dec 31 '15 at 5:02
3

These are instructions for getting the client ID and secret for oAuth.

This explains the process of navigating the Cloud Platform and getting your Apps Script project information including the client ID and secret.

An Apps Script project is initially given a "default" Google Cloud Project, but you will need to create a "standard" Google Cloud Project, and then associate the Apps Script project with the Google Cloud Project. To create a "standard" Google Cloud Project, you must first open the Google Cloud Platform dashboard at:

Google Cloud Platform

Then you need to create a new Cloud Platform Project, get the Cloud Platform Project id number, and add it to the Apps Script Project.

First go to IAM & admin, and choose "Manage resources" Click "Create Project"

Create a project, and get the id number. Go back to the Apps Script code editor, and open the Resources menu. Enter the id number and associate it with the Apps Script project.

  • In the "Resources" menu, choose the "Cloud Platform Project" item.

Cloud Platform Project

Dialog comes up:

Developers Console Dialog

Click Blue Link. Developers Console comes up. Navigate to Credentials.

Navigate to Credentials

In the Credentials page, click on either the Name or the "Edit OAuth Client" (pencil) icon.

Click on Name in Credentials

Get the client ID and the client secret. You will need this for the oAuth authorization.

Client ID and Secret

You must also enter a Redirect URI:

Quote from Eric Koleda's apps-script-oauth2: Eric Koleda's apps-script-oauth2

Before you can start authenticating against an OAuth2 provider, you usually need to register your application and retrieve the client ID and secret. Often these registration screens require you to enter a "Redirect URI", which is the URL that users will be redirected to after they've authorized the token. For this library (and the Apps Script functionality in general) the URL will always be in the following format:

https://script.google.com/macros/d/{PROJECT KEY}/usercallback

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.