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

Invalid access token #15

Open
sergeiknysh opened this issue Jan 5, 2020 · 4 comments
Open

Invalid access token #15

sergeiknysh opened this issue Jan 5, 2020 · 4 comments

Comments

@sergeiknysh
Copy link

I started this app as described in README file on http://localhost:8080/
Cesium´s viewport is empty, console shows {"code":"InvalidCredentials","message":"Invalid access token"}

http://localhost:8080/tile.html works fine.

Is it due to old AGI API?
Let me know how to configure my own access_token to Cesium.ion please.

@ghost
Copy link

ghost commented Jan 6, 2020

我也出现了cesium API 401 的问题,应该是access_token过期了

@ghost
Copy link

ghost commented Jan 6, 2020

你可以在node_modules/cesium/Source/Core/ion.js 中找到
'var defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJhMjZlY2NjMy01ODliLTQzNjEtOTkxYy03ZjM3MzlkZjJiYjgiLCJpZCI6MjU5LCJzY29wZXMiOlsiYXNyIiwiZ2MiXSwiaWF0IjoxNTQ2NDQ1NDExfQ.9TWMUlBZ-YJL0aGxr5ltSktgp8Y9r0ieycAljlKClEo';'这行代码,
把它的access_token改成自己的即可。 @sergeiknysh

@sergeiknysh
Copy link
Author

Thanks, I got your idea and now it works!

just added "Cesium.Ion.defaultAccessToken = '...'" into index.js

@swiss-knight
Copy link

swiss-knight commented Jan 15, 2020

Adding "Cesium.Ion.defaultAccessToken = '...'" into index.js doesn't work for me.

I got a 401 error from this server https://api.cesium.com/v1/assets/2/endpoint?access_token=... with this response:
{"code":"InvalidCredentials","message":"Invalid access token"}

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

2 participants