Places api uses client id (enterprise credentials) instead of apikey when both are configured

Offen
#828 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
38/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
java
Bereich
api, authentication

Rechercherichtung

Beginne damit, die Konstruktion der PlacesApi-Anfrage aus dem GeoContext nachzuverfolgen, der sowohl mit apiKey als auch mit enterpriseCredentials konfiguriert ist, und konzentriere dich dabei auf die im Bericht erwähnte Einstellung canuseclient. Reproduziere einen Places-autocomplete-Aufruf mit konfigurierten beiden Zugangsdaten und überprüfe, dass die abgeschlossene Anfrage den API-Schlüssel statt der client- und signature-Parameter verwendet.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

triage me type: bug

Hello,

We have an application that uses the Google API for PlacesAPI, TimeZoneApi and GeoCodingAPI.

Now we have a GeoContext spring bean defined where we set the API key and the Enterprise credentials. Which we inject in our service to use for the calls to the api's

// Config class
builder.apiKey(googleApiKey);
builder.enterpriseCredentials(googleClientId, googleCryptoKey);
builder.channel(googleChannel);	

// Call in the service
PlaceAutocompleteRequest request = PlacesApi.placeAutocomplete(context, query, googleSesionKey).language("en").await();

Whenever we do a call to the placesAPI then it builds the url like below with the client and signature instead of the apiKey

https://maps.googleapis.com/maps/api/place/autocomplete/json?**client=XXXXXXX**&input=fa&types=%28cities%29&language=en&sessiontoken=bb1fb770-76ec-42da-b80b-7ab82dd74f23&**signature=XXXX**

this gives us back an error stating that an api key must be provided.

During debugging of the placesApi I notice that it adds this clientid instead of APIKey when it is provided and because of a setting canuseclient is set to true.

Is this a bug that the placesapi config is wrong as it should not seem to use this clientid? I am also not sure where this can be modified to false.

Thanks

Vorherrschende Sprache
Java
Sterne
1.8k
Forks
972
Ø Merge
5 Std. 7 Min.
Gemergte PRs (30 T.)
1

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus googlemaps/google-maps-services-java

Alle Issues in googlemaps/google-maps-services-java

Ähnliche Issues

Weitere Issues zu Java

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.