Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
290 views
in Technique[技术] by (71.8m points)

security - Is it OK to store Google Map api key on Firestore ? (Calling from Flutter app)

TL;DL

Is it OK to store api key for Google map api on Firebase Firestore with security rules ?

Question

I'm working on map features using google_maps_flutter plugin. This package describes to store the key on source code on its document, but this seems to be insecure.

Many developers describing that the most secure way to manage api key is to store on server side and I agree with this idea.

I found the issue but it seems that the plugin does not have a way to provide the api key dynamically.

In the iOS sdk, they have GMSServices.provideAPIKey(Could not find same kind of methods on Android) and this allows to provide api key dynamically. If the plugin support these features in future, is it OK to store the key on firestore with security rules?

Thank you

question from:https://stackoverflow.com/questions/66055676/is-it-ok-to-store-google-map-api-key-on-firestore-calling-from-flutter-app

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

If your third-Party API Key are sensitive, they should stay on the server and never reach the User's device.

So, you could store them on Firestore with strong security rules (i.e. only readable with admin privileges) and then place the third-party API calls within Firebase Cloud Functions.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...