Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google API seemingly not working to display map #561

Open
Mereck13579 opened this issue Mar 13, 2023 · 4 comments
Open

Google API seemingly not working to display map #561

Mereck13579 opened this issue Mar 13, 2023 · 4 comments

Comments

@Mereck13579
Copy link

I've been trying to run my own "instance" of Airline Club on a personal server and managed to get apparently everything running, except for the Google API.
Basically whenever I log into the game I get this:
image

In my application.conf file I've set up those:

mysqldb.host="localhost:3306"
airline.akka-actor.host="127.0.0.1:2552"
google.apiKey="API key 1"
google.mapKey="Maps API Key"
play.allowGlobalApplication = true

[API Key 1 and Maps API Key are values that I've obfuscated for obvious reasons]

What I found strange is that the error in the javascript console isn't very telling:
image

The problem I see is that it's telling me that the referer is not allowed, but I have tried both unrestricted and restricting with different combination of FQDN/URL with no success (airclub.yangi.re / https://airclub.yangi.re / https://airclub.yangi.re/*)
One additional question might be, what's the difference between the "mapKey" and the "apiKey", I can't find any clue about which one does what (does both need to be different at all?)
Here is how the "Maps API Key" is set up for instance:
image

For additional context, the URL I'm using can access the internet but only some restricted IPs can access it (in case you wonder why it's not accessible).

@xrizonx
Copy link

xrizonx commented Jun 5, 2023

The issue is not with the MAP API Key its with your Other API Key you need to authorize the URL as its in the console exactly https://airclub.yangri.re would be yours.

also to add you need 2 different API keys i tested with both unrestricted and no security set if i share "Maps" API i get your error if not it works if i have 2 different api keys with security or not

Had the same issue with my API

@drvntechnologies
Copy link

So what's the fix? I'm having the same issue right now and I'm confused why I need 2 API keys as well and what that process is like. I have 1 API with maps enabled as well but I don't know if I just put that key in both places or if I need another key.

@Rustyt23
Copy link

Rustyt23 commented Jul 3, 2023

image
in the attached if you see closely you will find API key is used for map is backed somewhere and no getting updated "AIzaSyB5XQhzy2XrM95AyfW8f5BeWJiqr-LGXxU" this is the key if you see closely on console log ... application.conf API key never used

@Rustyt23
Copy link

Rustyt23 commented Jul 3, 2023

So what's the fix? I'm having the same issue right now and I'm confused why I need 2 API keys as well and what that process is like. I have 1 API with maps enabled as well but I don't know if I just put that key in both places or if I need another key.

If you can find the API key baked into the repo code or the database , then you can replace it with your API key and see if its working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants