I followed all the steps. I selected my desired API (YouTube Data API) and created a project.
I am searching now for about 20 minutes but I can't find the API Key?
My user interface is in german, is it possible that it is named to something else than API Key? Maybe Clientschlüssel (Client Key) ?
This is all I found:
There is also a JSON object, but no API Key:
var myInfos = {
"web":{
"client_id":"censored",
"project_id":"censored",
"auth_uri":"https://accounts.google.com/o/oauth2/auth",
"token_uri":"https://accounts.google.com/o/oauth2/token",
"auth_provider_x509_cert_url":"censored",
"client_secret":"censored",
"redirect_uris":["https://localhost/ex/YouTube/index.html"],
"javascript_origins":["http://localhost"]
}
}
Just to walk through this again to make sure you have done it properly.
Make sure you have a Google account.
Log into the developer console at: https://console.developers.google.com/
Create a project
THEN, select YouTube data API
Click create credentials on the right hand side of the screen.
Choose where you will call the API from
Pick public or User.
Obtain your API Key.
Optional: restrict your key.
I just walked though all of this and have been given a key myself.
sign into https://developers.google.com
https://console.developers.google.com/project - Create Project - enter Project Name - Create
select newly created project
Go to APIs Overview
click + Enable APIS AND SERVICES
type "YouTube" - select Youtube API v3 - click Enable
click Credentials - "Create Credentials" - API key
Copy and paste API key to text editor, e.g. notepad (save)
I finally found it!
You have to go to Zugangsdaten (Credentials) and then click on Anmeldedaten erstellen (create credentials), now you can select API Key!
Related
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
I am trying to implement google sign in using firebase in to my iOS app. I follow this tutorial.
https://firebase.google.com/docs/auth/ios/google-signin
I have setup the iOS app in firebase and use the google clientID and reversedClientID from the dowloaded GoogleService-Info.plist.
FYI: I have a custom sign-in button instead of the google sign in button. Anyway when i click the sign in button, google following error display in a webview.
I know my problem is the same as which described in this question.
Google 400 Error: invalid request Custom scheme URIs are not allowed for 'Web' client type
But, in my case, I have created the app in Firebase still I get the error. Any idea please...
The first step is to check if you have already the OAuth 2.0 ID for iOS. To do this please open the Credentials page in the API Console. I hope you will find iOS client for your application under OAuth 2.0 client IDs section. If not, please follow this Guide
The second step is to replace the Web Client ID with in iOS Client ID from OAuth 2.0 client IDs section. To do this, you should open the GoogleService-Info.plist and modify following keys: CLIENT_ID with [value].apps.googleusercontent.com and REVERSED_CLIENT_ID with com.googleusercontent.apps.[value].
if you're using flutterfire ui package you need to change the client id parameter in your GoogleProviderConfiguration class with the iOS client id,
you can copy it from here Credential page
example:
providerConfigs: [
GoogleProviderConfiguration(
clientId: "your copied key here"),
]
re-build you're app and you should be good to go
I've just faced this same issue using flutterfire_ui on Flutter.
The error appears to be from a couple of things. As Valeriy points out you need the ios client ID. But I still got the error if I used the scopes
openid
"https://www.googleapis.com/auth/userinfo.email",
"https://www.googleapis.com/auth/userinfo.profile",
Instead change these to
openid
email
profile
Strangely the opposite is true for Android, where the WebID and the first of the scopes should be used.
It also pays to be aware of the OAuth Content Screen..
In google cloud go to APIs & Services > OAuth consent screen > Edit.
You can add scopes here and fix any missing required fields that Firebase might not be filling out (I had 1). I believe this takes a while to propagate after a change, so give it an hour.
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.
Currently i am working on one of old project within that there is a client id and client secret. Now i want to update those with new client id and client secret using another Developer account. I followed each and every step from
https://developers.google.com/+/mobile/ios/getting-started
Google APIs Console - missing client secret
But i can see only client id. Where is the client secret ?
Here i can see only client id
Hey this is step by step process ,hope this helps you...
Step 1:
Goto Google Developer console and create new app
Step 2:Enable the google plus api
You can see the enable api in the Enable API's tab which is next to API Library ,which is visible in second image.
Step 3: Goto to credential in API & auth tab then select credentials option
select the type of authentication you require
then you will can see the configure consent screen configure the page with the information you wish to provide .
Step 4: Select the web Application option on top
and enter required url's
and finally click create button
once you do that ..you can see ...client id and client secret key...
When in iOS, the application type of the OAuth credential should be 'iOS'.
And then you should pass an empty string as the client secret in your code.
Keeping a secret (that is global to the entire application, not unique per user) in an app is NEVER EVER secure. See https://developer.okta.com/blog/2019/01/22/oauth-api-keys-arent-safe-in-mobile-apps This is an amazing article, please spend as much time as needed to understand it.
Because it can't be kept secure, using client secret in iOS is the old, outdated approach. Nowadays you want to use proof-key-code-exchange (PKCE). It's also explained in above link, but in short:
Generate a secret key in iOS, it is one time use for that one specific login
Only send the hash of the key to the login authority (Google). The original has not left the app yet
To get the tokens, you send: <AuthorizationCode,ORIGINAL secret> AuthorizationCode is also a one time use
Google can compare the "original secret" to the previously sent hash. It therefore knows you are not an attacker that has stolen the AuthorizationCode
Back to the question. Google let's you create different types of "Apps":
Web application: Has a client secret (It's on a backend server, not on a publicly accessible iOS app)
iOS app: Has "iOS URL scheme" instead. There are frameworks that use this URL scheme and do the steps I described above for you (including PKCE). Disclaimer: I'm not an iOS developer, but I'm 99% certain
I am trying to show nearby places with selected types
types - Bar, Cafe, ATM etc
I have created project on developer console.
enable API (google places api, google map sdk, direction api)
I have created iOS api keys but Api key not working. I got this error message
This IP, site or mobile application is not authorized to use this API
key. Request received from IP address 114.143.244.10, with empty
referer
When I tried browser api key I got this error
This API project is not authorized to use this API.
Please ensure that this API is activated in the APIs Console: Learn
more: https://code.google.com/apis/console
I am using this url
NSString *url = [NSString stringWithFormat:#"https://maps.googleapis.com/maps/api/place/search/json?location=%f,%f&radius=%#&types=%#&sensor=true&key=%#",
currentCentre.latitude,
currentCentre.longitude,
[NSString stringWithFormat:#"%i", currenDist],
googleType,
kGOOGLE_API_KEY
];
I didn't get what is the problem.
Enable to this api Google Places API Web Service & Google Places API for iOS in the APIs Console
Refer to this document....
Google Places API Web Service
https://developers.google.com/places/webservice/search
Please Check Your All API are Enable On The Google Developer Console
Step 1 Go to Developer Console
Step 2 API Manager ==> API Library ==> Google Maps APIs ==> More
Step 3 And Enable ==> Google Places API Web Service
(AutoComplete and Seaching)
Step 4 Done Enjoy (^_^) ALl Is Done !!!!
NOTE:- Make Sure Your API KEY is Proper and Created Okay ....
I think i know your problem now, it possible that you missed a step..
the steps are suppose to be:
1) Go to Developer Console https://code.google.com/apis/console/
2) In the Credentials, under Public API Access , Create New key
3) Select the server key from the option.
4) Enter your IP Address on the field and if you have more ip addresses, you can just add on every single line.NOTE: Enter the IP Address only when you want to use it for your testing purpose. Else leave the IP Address section blank.
5) Once you are done, click create and your new Server Key will be generated and you can then add that server key to your URL.
use it like:
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=[lat],[lon]&radius=[radius]&key=kGOOGLE_API_KEY&sensor=true
or from the tutorial that you are using..
https://maps.googleapis.com/maps/api/place/search/json?location=[lat],[lon]&radius=[radius]&types=[type]&key=kGOOGLE_API_KEY&sensor=true
as you can see &sensor=true is the last parameter..(don't trust anything on the internet).. hahaha..
everything must have been working if you have followed, carefully.. i suggest do it from the top.. hahaha.. Lols.. you'll know and learn what's missing/forgotten, and that'll help you be a better person.. Lols.. Good luck sir.. :)
Try to use this library https://github.com/FuerteInternational/FTGooglePlacesAPI with your key and let me know.