linkedin Uncaught Error: You must specify a valid JavaScript API Domain as part of this key's configuration

南楼画角 提交于 2019-11-27 17:26:06

问题


I have followed the instructions listed here in the 10 minute instructions: guide And the help from stackoverflow listed here: stackanswer

I still get this error:

Console.log error:

Uncaught Error: You must specify a valid JavaScript API Domain as part of this key's configuration.

My Code is this:

<script type="text/javascript" src="//platform.linkedin.com/in.js">
api_key:'98eeeu4fd587w4'
</script>

Where the api_key value is the value of Consumer Key / API Key from my app. And for the JavaScript API Domains I listed: http://mediaproof360.com,http://www.mediaproof360.com

After a day of research and trial and error I am hitting a wall.

Help is appreciated greatly. I have created a second app with credentials using that new API but still no luck.


回答1:


You can try this code

<script type="text/javascript" src="//platform.linkedin.com/in.js">
    api_key: 98eeeu4fd587w4
</script>

No quotes with api key will work. Add this section in the <head> element.




回答2:


Had the same error message thrown by Linkedn. Though my solution appeared to be different.

I didn't specify my app's domain in settings. After I added it, all started working well. Pay attention to trailing slash. It may also cause errors

Link to your apps https://www.linkedin.com/developer/apps/.




回答3:


Adding to @Rejeesh 's correct answer above, if you happen to echo the api_key from a configuration file and have other parameters such as "authorize: true" remember to add an end of line. For example, with PHP:

<script type="text/javascript" src="//platform.linkedin.com/in.js">
    api_key: <?php echo LINKEDIN_API_KEY . PHP_EOL; ?>
    authorize: true
</script>

If you don't do this you risk getting it all in the same line and you would also get the same error (your key would be invalid).




回答4:


Adding to @Rejeesh 's and morunas's correct answers you may need to check your application java script settings and add your domain their as mentioned in Linkedin documentation

https://developer.linkedin.com/docs/getting-started-js-sdk#initialize



来源:https://stackoverflow.com/questions/28506603/linkedin-uncaught-error-you-must-specify-a-valid-javascript-api-domain-as-part

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!