linkedin javascript api domain is restricted to localhost - javascript

I'm trying to use linkedin javascript api, but when I run a script I get an error 'javascript api domain is restricted to localhost'. Does anyone know what is that? Please, help!

Go to https://www.linkedin.com/secure/developer
Click on the application name you're using.
Add your domain to JavaScript API Domains:
Save changes.
This should fix your issue.

1 create a new app on LinkedIn devloper
2.in URL you should write path like this
http://localhost/linkdin/index.php/
then save
after it your problem will be resolve

Related

Facebook Messaging API Checkbox Plugin

Can anyone tell me where to get the PAGE_ACCESS_TOKEN??
I try to connect my website using Facebook's Messenger API, but I'm stuck trying to whitelist my domain because it requires a PAGE_ACCESS_TOKEN.
Where can I find my PAGE_ACCESS_TOKEN?
https://developers.facebook.com/docs/messenger-platform/plugin-reference/checkbox-plugin
Please help
Thanks
You need to start reading at the very beginning, donĀ“t just jump in at a random place in the docs: https://developers.facebook.com/docs/messenger-platform/guides/quick-start
Take a look at number 3: "Get a Page Access Token"

To Check google site access permission from App Script

Is it possible to check whether one have access to Google site using the site url in Apps Script?
My requirement is that when someone clicks on google site link and if they don't have access then they should be redirected to custom Access denied page.
I tried using UrlFetchApp but it didn't return anything relevant in order to distinguish whether one has the access to google site or not.
Please help!
Finally SitesApp.getSiteByUrl(link) helped to resolve my issue. If it throws an exception that means user don't have access to the site.
Documentation

Use Google Map V3 API ClientID in Application with no URL

Need to get Google Map V3 API work in my application with purchased ClientID.
The application is using WebBrowser Control to load html into documentText and the Url is 'about:blank'. The problem is I can't put about:blank into authorized URLs list in google map console. Also I can't host html as it needs a lot of data from database. It must be in application. Can anyone help me how to use google map clientID in application? Thanks a lot.
Error: This page was unable to display a Google Maps element. This URL
is not authorized to use the provided Google Maps Client ID. Error
Code: UnauthorizedURLForClientIdMapError
Got support from google. To use Client ID this way, they actually have to manually add 'about:blank' into white list.
about:blank is not a URL, it is in some sense the absence or a URL. In fact, loading the API from about:blank does not send a referer header, and window.location in about:blank is empty.
What this means is that you cannot restrict your client id to a specific URL whitelist if you intend to use the API in this way. This would, however, mean that your client id could be used from any host.

How to login with facebook using JS API from WebView

I want to login with FaceBook from mobile devices(WebView).
I'm trying to login using the example from this tutorial https://developers.facebook.com/docs/facebook-login/login-flow-for-web
But I'm getting the following error
Given URL is not allowed by the Application configuration.: One or
more of the given URLs is not allowed by the App's settings. It must
match the Website URL or Canvas URL, or the domain must be a subdomain
of one of the App's domains.
According this manual, I must using faked redirect_uri for oauth service to login from WebView
https://www.facebook.com/connect/login_success.html
Now, connection string looks like this
https://www.facebook.com/connect/ping?client_id=188978851312862&domain=&origin=1&redirect_uri=http://static.ak.facebook.com/connect/xd_arbiter.php?version=29#cb=fc2b211fc&domain=&origin=file%3A%2F%2F%2Ff3b6d7ef1c&relation=parent&response_type=token,signed_request,code&sdk=joey
And if you go to this link, you will get the error. But if i change redirect_uri to this
https://www.facebook.com/connect/ping?client_id=188978851312862&domain=&origin=1&redirect_uri=https://www.facebook.com/connect/login_success.html&domain=&origin=file%3A%2F%2F%2Ff3b6d7ef1c&relation=parent&response_type=token,signed_request,code&sdk=joey
It will succeed.
Is it possible to set faked redirect uri and use standart JS API?
UPD: Actually authorizing complete well, but the API's event (auth.authResponseChange) doesn't fires. The problem in origin parameter in redirect_uri which is set to file:// when I loginnig from mobile's WebView.
As far as I can tell, the advice to, if you're in a WebView, "redirect to https://www.facebook.com/connect/login_success.html" is so that it will redirect there, with some auth keys "also in the url" and then you can parse them and close your WebView, so basically a one time callout, FWIW. My other guess is that origin is there, but not actually checked or used by them [?]
In terms of "using the standard JS API" I think you can but it's non trivial see here.
https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow/v2.0 Are you using this? If you need any more help give me a buzz, just made one of these

Get GA URL pageviews with JS?

Google analytics tracks pageviews.
I would like to use JavaScript to fetch the number of views that a specific page URL has.
How can I do this?
P.S. Google documentation is a mess, all I can find out from it is how to setup tracking.
Doing this purly in javascript is going to be tricky. Due to the fact that you will need authorization to access your data.
Now normaly for a case like this I would say use a service account but in order to use a service account to connect to google analytics, you will need to download a key file. This file must be kept save and secure.
Javascript is client side scripting how can you send a file that no one else should be allowed to access? As far as I know there are no javascript examples for using a service account to access google analtyics i have also been unable to come up with a safe and secure way of doing this myself. If any one has any ideas please comment i would love to hear how you got this working.
The only other option is to go with normal autentication the problem with this is that you will need to autenticate the script. Thats not hard you could then save the RefreshToken some place and pass it to the page. Again this is a problem anyone that then looks at your source code will have the RefreshToken and the ability to access your data.
My recomendation: Use some server sided scripting language like php for example.
If you want to look at the code for doing this in javascript Hello-analytics-api

Categories