How to add new scopes in Google Console? - oauth-2.0

I create new service account to use Google API and Oauth 2.0 in my web app.
I need to add these scopes in Google Console:
https://www.googleapis.com/auth/gmail.modify
https://www.googleapis.com/auth/gmail.compose
https://www.googleapis.com/auth/gmail.send
https://www.googleapis.com/auth/gmail.readonly
In old version of Google Console I had "Add scope" button, but I can't find it in new version of https://console.developers.google.com/

Inorder to add new scopes scroll up in the same page as shown in your image, then you can see the option "edit app".
image1
Once you click it you will be presented with a screen like the
following image shown below.
image2
Since you wanted to add new scope just ignore the first page (i mean: scroll down, save and continue) in the second page you can manage your scopes using the "add or remove scope" option.
image3

Related

'gcloud alpha iap oauth-brands create' getting INVALID PARAMETER

For some reason I deleted so called brand entity at my gcloud console. Now I want to create new one using the command in the console:
gcloud alpha iap oauth-brands create --application_title='EmojiRave' --support_email='rebelusgames#gmail.com'
But the console returns me back : INVALID_ARGUMENT: Request contains an invalid argument.
I've used different formats (using brackets and without them)
I've checked whether I have enough permissions to do it (I use owner account, so it's enough permissions)
I'm desperate.
There are two potential reasons for the failure:
1. Incorrect email address. According to the docs: "This [support] email address can either be a user's address or a Google Groups alias. [...] Note: The user issuing the request must be an owner of the specified support email address."
2. Project is not in an organisation. According to this source (see under limitations): If you're [..] outside a Cloud Orginization most likely you'll get an error on step "Creating oauth brand".
Overall, my suggestion is to update the OAuth Consent Screen via GCP Console.
Go to the Google Cloud Platform Console.
From the projects list, select a project or create a new one.
If the APIs & services page isn't already open, click on the Navigation Menu on the upper left and select APIs & services.
On the left, click OAuth Consent Screen.
Click Edit App.
First, it's not possible to delete the OAuth Consent Screen (Brand) once created. This can be seen from #DaImTo's answer, and the lack of delete option in both gcloud command and in the console.
I also tested your command on my Cloud Shell and it works fine as well. I've checked the documentation with regards gcloud alpha iap oauth-brands and it is currently in ALPHA state. It may change without prior notice and it may not be stable or work to all users. If you still want to use the CLI and request to be allow-listed regarding this command, my suggestion is to contact sales, as instructed on the issue tracker you've made.

Setting up Google Sheets for Developers with node.js, after allowing my API to view my spreadshhets, it redirects to a "Page not found"

I'm trying to get the Google Sheets API to work with node and I've got as far that it asks me to sign it with my Google account and the allow the app to view my Google Spreadsheets. After I press allow it redirects me to a Page not found saying "ERR_CONNECTION_REFUSED". In the URL it reads "code=4" but I can't find what this stands for. I'm currently stuck in my console waiting for a code from this page. .
My code is the exact same as on the API documentation but I had to change "credentials.installed" to just "credentials" because otherwise it didn't work.
Has it maybe something to do with my callback URIs? I have both "Authorised JavaScript origins" and Authorised redirect URIs" as just "http://localhost:8080".
My credentials.JSON looks like this
{
"client_id":"XXXX",
"project_id":"XXXX","auth_uri":"https://accounts.google.com/o/oauth2/auth",
"token_uri":"https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs",
"client_secret":"XXXX",
"redirect_uris":["http://localhost:8080"],
"javascript_origins":["http://localhost:8080"]
}
In summary: I get a "Page not found" instead of the code that you're supposed to paste to the console after I press the "Accept" button.
I selected "web application" instead of "desktop application". Just download credentials JSON and copy code directly from quick start and it will work. My bad.

Google sign-in showing incorrect project name - iOS

I have been integrating Google sign-in for syncing the calendar events using Google Calendar API. While trying to sign in, I am getting this.
As you can see the name of the project/app is displayed as "project-xxxxxxxxx" rather than the project name itself. How can I display the original project name here?
I have already tried
How do I set the project name in the Google iOS Sign-In screen?
, but of no use!
Atlast I found it!
I am also using Firebase for database. So when I checked its console , there is an option "Public-facing name" and renamed it. It worked!
Steps for the solution:
Go to Firebase Console and select the project.
Under Settings, select the General tab.
Change the Public-facing name by clicking the Edit button and then Save.
Please check the below image.
You need to create the OAUTH Client_ID by mentioning with your project name. It will display the same name which you specify in Google auth Console.
click here to open google auth console.
Open: Google Clound Platform /
APIs & Services / OAuth consent screen
Edit project name

MVC 5 App with Google OAuth2 Sign-on (C#) is not working

I have followed some articles, but all are not clear as google oauth interface is changed.
Verified some articles, and understood something. With this understanding in mind, followed below steps:
Opned URL: console.developers.google.com
Created new project with name: My Super App
Clicked on Google+ API under Overview section, and Enabled the same.
Here is my doubt whether I am doing correct or not
Selected OAuth ClientID option under Credentials section.
Configured Consent screen With email address, and Product name.
Under Create Client ID section, provided below details:
Application type: Web Application
Name: My Super Client App
Authorized Javascript origins: http://localhost:44300/ - sometimes, I have used this option. Later on, now, I am not using this option. Please suggest me if it is mandatory.
Authorized redirect URIs: http://localhost:44300/signin-google
ClientID, ClientSecret have been generated. Used in My MVC app.
But, I am unable to use Google OAuth.
Please suggest me where I'm doing wrong.
Go to your Project properties and under the Web tab you'll see the Project URL. In place of the https://localhost:44300/ given in the article replace it with the one specified in Project URL or, if you've overridden that one, use the one specified in the Override application root URL.
In other words, you shall change the URL here:
Just a suggestion but perhaps you need to enable the api on your google developer console. I did a quick google and this covers it - http://www.c-sharpcorner.com/article/how-to-configure-google-sign-in-for-Asp-Net-mvc-5-part-sixt/
please follow Asp.net/mvc :MVC5 :Google OpenAuth from where the below steps are taken:
Creating a Google app for OAuth 2 and connecting the app to the project
Navigate to the Google Developers Console.
Click the Create Project
button and enter a project name and ID (you can use the default
values). In a few seconds the new project will be created and your
browser will display the new projects page.
In the left tab, click
APIs & auth, and then > Credentials.
Click the Create New Client ID
under OAuth. In the Create Client ID dialog, keep the default Web
application for the application type.
Set the Authorized JavaScript
origins to the SSL URL you used above (https://localhost:44300/
unless you've created other SSL projects) Set the Authorized
redirect URI to:
https://localhost:44300/signin-google
Click the Consent screen menu item, then set your email address and product name. When you
have completed the form click Save.
Click the APIs menu item, scroll
down and switch on Google+ API.
Copy and paste the AppId and App Secret into the UseGoogleAuthentication method. The AppId and App Secret values shown below are samples and will not work.

Facebook Graph API doesn't return profile image for one page

Apologies, I can only include 2 URLs as a new user so I have had to econonomize.
I am having a problem where the user object in Facebook's Graph API is not returning a profile image correctly. I can only find one case of this problem. For all other uses I have tested it appears to be working correctly. The profile image doesn't seem to have any privacy settings, since I'm able to view it normally from the profile page.
I am using Facebook's Graph API to load the profile image for a user/page by putting this URL into an IMG tag:
https://graph.facebook.com/[profile-id]/picture?type=square
This has worked in all cases I found during testing, including pages and users. For one of our users deploying the app on a page, however, the URL is loading the question mark image, as though there is no profile image for the page. Their page clearly has a profile image, as you can see here:
http://www.facebook.com/EgansRestaurantPub
But if you click through to the Egan's Calendar tab, you'll see the question mark image. The image URL is the following, which returns the question mark:
https://graph.facebook.com/400488613342471/picture?type=square
I've checked the ID using the following link format, to ensure it's the right ID for the page:
http://www.facebook.com/pages/[anything]/400488613342471
My first theory was that there were privacy settings on the profile image, but my personal account (as a non-fan of the page) is able to view the profile image. My only other idea is that perhaps it is because the page uses a short URL (EgansRestaurantPub) that doesn't include the page ID. For similar pages, I found using the following worked:
[graphurl]/cocacola/picture
[graphurl]/BMW/picture
But when using the same method for my client's page, it still returns a question mark.
Does anyone know why this is not returning the profile image for this page? This is the only page where I have found this problem.
I am using the PHP SDK and a bit of the JS SDK. I would prefer to avoid making another call to the API that would delay loading the page. That's why I liked being able to throw the URL straight into the IMG tag. But I will make another call if there is no other way.
It seems there is some kind of restriction as mentioned in the user document (picture field):
access_token required for pages with whitelisting/targeting
restrictions, otherwise no access_token required
You just need to supply a user access_token for this to work:
https://graph.facebook.com/400488613342471/picture?type=square&access_token=XXX
To test this, you can directly get an access_token from the Access Token Tool.

Resources