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

Abierto
#828 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
38/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
java

Línea de trabajo

Comienza rastreando la construcción de la solicitud de PlacesApi desde el GeoContext configurado con apiKey y enterpriseCredentials, centrándote en la configuración canuseclient mencionada en el informe. Reproduce una llamada de Places autocomplete con ambas credenciales configuradas y verifica que la solicitud completada use la clave de API en lugar de los parámetros client y signature.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
Java
Estrellas
1.8k
Forks
972
Merge medio
5 h 7 min
PR fusionados (30 d)
1

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de googlemaps/google-maps-services-java

Todos los issues de googlemaps/google-maps-services-java

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.