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

Đang mở
#828 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
38/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
java
Lĩnh vực
api, authentication

Hướng nghiên cứu

Bắt đầu bằng cách theo dõi quá trình xây dựng request PlacesApi từ GeoContext được cấu hình với cả apiKey và enterpriseCredentials, tập trung vào thiết lập canuseclient được đề cập trong báo cáo. Tái hiện một lệnh gọi Places autocomplete với cả hai thông tin xác thực được cấu hình và xác minh rằng request hoàn chỉnh sử dụng API key thay vì các tham số client và signature.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Java
Star
1.8k
Fork
972
Merge trung bình
5 giờ 7 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của googlemaps/google-maps-services-java

Tất cả issue của googlemaps/google-maps-services-java

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.