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

Aperta
#828 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
38/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
java

Direzione di ricerca

Inizia tracciando la costruzione della richiesta PlacesApi dal GeoContext configurato con apiKey ed enterpriseCredentials, concentrandoti sull'impostazione canuseclient menzionata nel report. Riproduci una chiamata Places autocomplete con entrambe le credenziali configurate e verifica che la richiesta completata utilizzi la chiave API anziché i parametri client e signature.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Java
Stelle
1.8k
Fork
972
Merge medio
5h 7m
PR unite (30g)
1

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di googlemaps/google-maps-services-java

Tutte le issue di googlemaps/google-maps-services-java

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.