Linkedin Javascript SDK - Setting the SDK Domains in the app configuration page has no effect - linkedin

No matter how hard I try, and no matter the url format I'm giving in the Setting the SDK Domains section of the Linkedin Javascript SDK, I keep getting this error in my console:
Uncaught Error: You must specify a valid JavaScript API Domain as part of this key's configuration.
My setup it's as simple as possible :
<script type="text/javascript" src="//platform.linkedin.com/in.js">
api_key:afyXZGKtvrVoXXXX
</script>
I've tried all the URL variations in the SDK Domains section:
having localhost with and without port ( http://localhost:9000 )
having a custom hostname with and without port ( http://dev.local:9000 )
having a real existing domain name ( heroku app ) (http://somename.herokuapp.com)
Nothing worked, keep getting the same error.
Any advice appreciated.
Thank you,

Try this:
<script type="text/javascript" src="//platform.linkedin.com/in.js">
api_key:afyXZGKtvrVoXXXX
authorize: true
</script>

Related

Firebase CDN unreachable from some networks

I'm using firebaseui in a web app and I get this error in the console logs:
Loading failed for the with source “https://cdn.firebase.com/libs/firebaseui/3.5.2/firebaseui.js”.
The auth UI itself, as expected, doesn't load. The domain cdn.firebase.com resolves to:
Name: f6.shared.global.fastly.net
Address: 151.101.154.202
It resolves to a different IP address from hosts from which the auth UI loads. Is there anything I could do to ensure that the firebase auth UI loads reliably regardless of where the host is located?
Thanks,
Abhishek
The Firebase UI Web library is hosted on both the cdn.firebase.com and gstatic.com CDNs.
Try using this instead:
<script src="https://www.gstatic.com/firebasejs/ui/3.5.2/firebase-ui-auth.js"></script>
<link type="text/css" rel="stylesheet" href="https://www.gstatic.com/firebasejs/ui/3.5.2/firebase-ui-auth.css" />

Ionic Serve: Accessing google geolocation api via localhost is working, but when the serve address changes its not working

I am a newbie exploring about Ionic Apps.I am running my ionic server on http://localhost:8100. My App need the users current location.
I have added this
<script src="http://maps.google.com/maps/api/js?key=AIzaSyB16sGmIekuGIvYOfNoW9T44377IU2d2Es"></script>
in index.html
And my app.js has
var options = {
enableHighAccuracy: true
};
navigator.geolocation.getCurrentPosition(function(pos) {
$scope.position = new google.maps.LatLng(pos.coords.latitude, pos.coords.longitude);
console.log(JSON.stringify($scope.position));
},
function(error) {
alert('Unable to get location: ' + error.message);
}, options);
And added the following in config.xml
<allow-navigation href="*://*.googleapis.com/*"/>
I got the current location in $scope.position. But the problem comes when I tried running my app in mobile.So,I have connected my ubuntu to my mobile hotspot with IP-192.168.43.86. I tried running my ionic serve on http://192.168.43.86:8100 using
ionic serve --address 192.168.43.86
Now the above getCurrentPosition function is returning error stating
only secured origins are allowed.
So,I'm not sure whats happening there. Both localhost and 192.168.43.86 are http server only. But running the server in localhost has no issue. But changing the address is returning error. Am I missing something? Can someone help?
First, make sure you have whitelisted the IP address you are using to access the maps API in the Google Developer Console. When you are running on a native device, especially iOS, you will also need to include the cordova-plugin-whitelist in order to explicitly whitelist unsecured origins. Here is an example of the meta tag I use for development, it goes in the <head> tag of your index.html:
<meta http-equiv="Content-Security-Policy" content="default-src 'unsafe-inline' 'unsafe-eval' 'self' data: gap: *;">
You can learn more about the cordova whitelist plugin here.

Angular Meteor Socially Tutorial - Google Maps not loading - MissingKeyMapError

I am getting this error when trying to load google maps
Google Maps API error: MissingKeyMapError
I am accessing the application on my localhost http://localhost:3000/
After googling I noticed that an API key needs to be passed to resolve this error, but how do I pass this key? I don't see any attributes related to this key for sebm tag.
Party-detail.html has the following:
<sebm-google-map
[latitude]="lat || centerLat"
[longitude]="lng || centerLng"
[zoom]="8"
(mapClick)="mapClicked($event)">
<sebm-google-map-marker
*ngIf="lat && lng"
[latitude]="lat"
[longitude]="lng">
</sebm-google-map-marker>
</sebm-google-map>
You may place following the script in your index.html file
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_GOOGLE_MAPS_API_KEY_HERE"></script>
before
<script src="build/js/app.bundle.js"></script>
and you may manage an api key form
https://developers.google.com/maps/documentation/javascript/

Implementing GIT Kit in .NET Web Api

I'm attempting to implement the GITKit in a Asp .NET Web Api 2 application.
I followed the instructions on the google developer kit. When I go to my sign in page, it redirects to accountchooser.com. So far, so good. I have a google account shown, so I select it. The page reloads, but it is completely blank. No call is received on my sign in successful url. The javascript console shows:
Uncaught Error: At least one sign in option should be specified! gitkit.js:250
Any ideas? What am I doing wrong? How does one debug the various calls to see where things are going haywire?
Thanks.
in your sign in html page where window.google.identitytoolkit.start() is called, you need to pass a configuration object to the start() method with signInOptions defined. Below is an example:
<script type="text/javascript" src="//www.gstatic.com/authtoolkit/js/gitkit.js"></script>
<link type="text/css" rel="stylesheet" href="//www.gstatic.com/authtoolkit/css/gitkit.css" />
<script type="text/javascript">
var config = {
apiKey: '...',
signInSuccessUrl: '/',
signInOptions: ["google", "password"]
};
window.google.identitytoolkit.start(
'#gitkitWidgetDiv', // accepts any CSS selector
config);
</script>

Error Message: redirect_uri is not owned by the application

::UPDATE:: LINKS DO NOT EXIST ANYMORE!
Very strange indeed, this is definitely a bug! I did a test with app_id from another application and it worked.
See for yourself:
https://apps.megalopes.com/megabraziltv/test.php (app_id correct)
https://apps.megalopes.com/megabraziltv/test2.php (app_id from another application)
---/---
I found several people with the same question and all the answers are equal:
Site URL is not same as REQUEST_URI (Redirecting URL)
My app setting are:
Secure Page Tab URL: apps.megalopes.com/megabraziltv/...
App Domain: megalopes.com
code:
<div id="fb-root"></div>
<script src="http://connect.facebook.net/pt_BR/all.js">
</script>
<script>
FB.init({
appId:'123456789', cookie:true,
status:true, xfbml:true
});
FB.ui({ method: 'apprequests',
message: 'Here is a new Requests dialog...'});
</script>
This simple code is not redirecting to any other url. I tested on the js console getting the same results. Sometimes works and sometimes I get this error message:
API Error Code: 191 API Error Description: The specified URL is not
owned by the application Error Message: redirect_uri is not owned by
the application.
Regardless of being page tab or canvas, you must identify the website Site URL in https://developers.facebook.com/apps
How I fixed:
App Domain: megalopes.com (domain)
Site URL: / Secure Canvas URL: / Secure Page Tab URL: https://www.megalopes.com (subdomain)
I think I have run into something similar before.
In the summary page of your app ensure both the Secure Canvas URL and Page Tab URL are populated.
The URL in my redirect_uri should have "http://" in the beginning. It was missing the protocol information, thus leading Facebook not to recognize my website and throw this annoying 191 error. I finally found out after one hour pulling the hair I (still) have left.
You have to create a channel page, which allows "cross domain communication in certain browsers"
This is an html page (saying /channel.html) on your server, which only contains :
<script src="//connect.facebook.net/en_US/all.js"></script>
And make the Javascript SDK aware of it :
FB.init({
appId: 'xxxxxx',
cookie: true,
channelUrl: location.protocol + '//' + location.host + '/channel.html'
});
More about this :
https://developers.facebook.com/docs/reference/javascript/FB.init/
https://developers.facebook.com/docs/reference/javascript/
It's because of domain URL that you mentioned in facebook's mistake. Domain URL wont be like www.site.com
Update your domain url like subdomain.site.com.
Now it surely work.

Resources