Google Identity Service auto sign-in - google-signin

This is a very simple version of the code we have that's failing.
Following the guidance on Automatic Sign-in we have a very simple web page:
<html>
<head>
<title>Google Signin Testing</title>
<script src="https://accounts.google.com/gsi/client" async defer></script>
<script>
function onSignIn(credentialResponse) {
document.body.innerHTML = "Signed in";
}
</script>
</head>
<body>
<div
id="g_id_onload"
data-client_id=<our-client-id>
data-context="signin"
data-ux_mode="popup"
data-callback="onSignIn"
data-auto_select="true"
></div>
<!--<div class="g_id_signin"
data-type="standard"
data-shape="rectangular"
data-theme="outline"
data-text="signin_with"
data-size="large"
data-logo_alignment="left">
</div>-->
</body>
</html>
Because data-auto_select="true" this should automatically sign-in without having to sign in each time the user reloads the page. But that's not what's happening: https://games.tactiletimes.org/signin.html
What are we missing?

We were logged in to Google with multiple accounts, so the auto sign-in did not know which one we wanted to use for the page. The documentation (here) says:
If a user has multiple Google accounts and visits your site they are required to first sign-in to a single Google account
If I sign out of all accounts on Google, and then sign into Google with just one of my accounts, then the auto sign-in works on our pages.
The previous Google authentication APIs did not have this requirement.

It's worth noting that the previous versions of the Authentication SDKs did not offer Automatic sign-in. It's a new user flow with a new and different set of requirements. The two other user flows: One Tap and the Sign In With Google button may be more what you're expecting; both offer the ability to use an account chooser as part of the normal flow.
To expand on this slightly; choosing one Google Account and signing into that account are required steps, if a device or browser has an active session with the Google Account the account choice and sign-in step may be skipped. That's automatic sign-in in a nutshell.

Related

Google Analytics - How to set up Google Analytics for Email Open-rate Tracking?

I have a requirement of tracking email open rates.
So I decided to use Google Analytics for this purpose. Most of the online tutorials were using "Google Pixel Tracking" for this purpose. The idea is used to add a Tracking script on the IMG source in the Email. The Image (1x1 pixel) will be uploaded on the GA server. When the User opens the email, the image will be downloaded and the GA server will record the details.
However, In the current version of Google Analytics, I am not able to achieve this. There is no option to upload a "pixel"
Things have changed in the recent version of Google Analytics. If somebody has got this working, please let me know how you did it.
You can do it with Google Analytics through Measurement Protocol, placing an image tag within the email.
...
<img src=
"https://www.google-analytics.com/collect?v=1&tid=ABC&cid=555&aip=1&t=event&ec=email&ea=open&dp=%2Femail%2Fnewsletter1&dt=My%20Newsletter">
...
</body>
</html>
https://developers.google.com/analytics/devguides/collection/protocol/v1/email

Is it possible to avoid Google Hangout Chat link preview's displaying authentication challenges?

Hi we use Google Hangouts Chat at work. We like seeing link previews, but if we link to an internal resource protected by gsuite autherization, the link preview is just a box telling the bot to sign in. Is there a way of avoiding this?

Does Linkedin API provide a way to get the Recent Updates from our company's profile

I am working on building our external web site for the company, and I want to show our company's LinkedIn profile's Recent Updates inside our web site. Currently when I access our company LinkedIn profile I can see those recent updates, which are available to public users as well (so users do not have to login to Linkedin to view those Recent Updates), as follows:
I read about the LinkedIn JavaScript API, and the capabilities it provides, and I already created a new LinkedIn Application and I set the required setting as mentioned on this link https://developer.linkedin.com/docs/getting-started-js-sdk but I got confused on how I need to use it and how the authentication will be managed.
I have the following questions:
Can anyone link me to some sample Code about using LinkedIn JavaScript SDK to get our company Recent Updates?
How the authentication for the LinkedIn JavaScript SDK work? I mean does the SDK allow getting our LinkedIn company profile's Recent Updates without require the user to be login to LinkedIn in advance? again our company Recent Updates can be viewed by any user who access our LinkedIn profile page (user does not have to be login to linked to view our profile and our Recent Updates). And since we are planning to show the Recent Updates inside our external web site, so we can not assume that any user who will view our web site is already login to LinkedIn to view those LinkedIn Recent Updates, or that the user has a LinkedIn account in the first place.
Edit
Based on the reply from #Craig Wayne. Now in my case I did not set any thing regarding the OAuth, since I only configure the required steps for the JavaScript as follow, so is this fine?:
Now I tried to use this link https://codepen.io/craigiswayne/pen/KGbqRq to test the Api call, where I entered the following info:-
Client ID: - "I entered out client id 14 digit"
REST URL:- "companies/<<our 8 digits id>>/updates?start=20&count=10&format=json"
but it keep trying to load the results, as follows:
Now final step inside our Sharepoint page I added the following code:
<script type="text/javascript" src="//platform.linkedin.com/in.js">
api_key: 14 digits code
onLoad: LinkedINJSAPI.onLoad
authorize: true
credentials_cookie: true
credentials_cookie_crc: true
</script>
<script>
var LinkedINJSAPI = {
onLoad: function(){
IN.User.authorize(LinkedINJSAPI.request, this );
},
request: function(){
var url = 'companies/<<>8 digits code>>/updates?start=20&count=10&format=json';
IN.API.Raw(url).
method('GET').
result(function(result){
console.log( JSON.stringify( result ) );
}).
error(function(error){
console.error( error.message );
});
}
}
</script>
where I got a popup from linked to enter a username and password,and after login, I got this error inside the browser console:
Member does not have permission to get company.
LinkedIn has an extensive API.
Does LinkedIn API provide a capability to get the company's Recent Updates?
Yes. LinkedIn API's provide the last 50 updates, including Job Postings, New Products, and Status Updates. Consult the API reference for company updates.
Can we securely integrate with the API using client side code (JavaScript)?
Yes. LinkedIn provides a JavaScript SDK. You should start by consulting their Getting Started with the JavaScript SDK guide, then look at their Company Pages guide.
Are API capabilities offered for free?
I can't find any documentation for pricing. It appears to be free with a rate limit throttle.
Can anyone link me to some tutorials & docs about integrating with LinkedIn apis using javascript code? and how we need to register with these APIs?
If you sign in to their developer site, you can create an application that will grant you the ability to make API calls.
Getting Started with the REST API guide
Get a company's updates
Create an Application to use the API's in their Developer site (requires free login)
Is there an RSS feed that can achieve these same goals?
There is an existing answer that outlines using RSS for displaying company updates.
Add your LinkedIN JS SDK to your site, should look something like this:
<script type="text/javascript" src="//platform.linkedin.com/in.js">
api_key: <!-- YOUR CLIENT ID (API KEY) HERE -->
onLoad: LinkedINJSAPI.onLoad
authorize: true
credentials_cookie: true
credentials_cookie_crc: true
</script>
After which in your JavaScript add in the following:
var LinkedINJSAPI = {
onLoad: function(){
IN.User.authorize(LinkedINJSAPI.request, this );
},
request: function(){
var url = 'companies/1337/updates?start=20&count=10&format=json';
IN.API.Raw(url).
method('GET').
result(function(result){
console.log( JSON.stringify( result ) );
}).
error(function(error){
console.error( error.message );
});
}
}
You can see a working demo here...
https://codepen.io/craigiswayne/pen/KGbqRq
Member does not have permission to get company
can you confirm that the person that you login as has administrator permissions on the company page ?
if you login with the account on linkedin , do you see a manage option for the business page when you press on the "me" option next to the notifications.
because someone that wants to get company data has to be an administrator of the linkedin company page.

Adding google analytics to tizen

I am trying to add google analytic to tizen web-app with the help of this link
https://www.samsungdforum.com/SamsungDForum/ForumView/7e2b7fa90012098b?forumID=abebd8c49fee8b80
But when I am running my app its throwing error-
FileSystem not defined in stats.js
The first, Tizen is running by the local file:///, which is not http or https.
So you can not add it to your index file normally as google guides.
Remove all relevant code in tag and using below snippet code if you interactive with google tag manager(do the same with google analytic).
<body>
<noscript>
<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-xxxxxx"
height=0 width=0 style="display: none; visibility: hidden"></iframe>
</noscript>
<script type=text/javascript
src="https://www.googletagmanager.com/gtm.js?id=GTM-xxxxxx"></script>
<script type=text/javascript
src=https://www.google-analytics.com/analytics.js></script>
The seconds, you need configuration the Google Analytics Tag. Because GA places some restrictions on the web brower:
-The host making the requests to GA needs to have either http or https as the protocol.
-The host must support storing the Client ID in browser cookies.
-The host must be able to pass a proper Document Location value (the URL) to Google Analytics.
For more information, please follow this bog of an Google Developer Expert
https://www.simoahava.com/analytics/run-google-tag-manager-google-analytics-local-files/
As you use the example of SamsungDForum, it is better to forward this in that forum.
I found another example there for google analytics, it may be help you..
https://www.samsungdforum.com/SamsungDForum/ForumView/3ad8bd6023af18a7?forumID=1195f8970c4eea64

Accessing Google analytics api using api key

I'm trying to implement Google analytics API using API key to make it available without authorization. But i can get examples using CLIENT ID in google developer console itself. Can anyone help me with an example using api key?
It is not possible to access Google Analytics API with the API key. You must use Open Authentication.
If you are trying to access your own data you can use a service account. Create new credentials choose Service Account.
You can then take the service account email address:
1046123799103-nk421gjc2v8mlr2qnmmqaak04ntb1dbp#developer.gserviceaccount.com
Add it as a user at the ACCOUNT level it is very important that it be at the ACCOUNT level it wont work other wise. Your application with then be able to access your Google Analytics data with out a log in.
Without knowing what language you are working with I cant give you any examples.
Update:
If as you say you are planning on doing this with JavaScript then you will have to go with Oauth2 and request access. There is no way to use a Service account with JavaScript.
There for I strongly recommend that you find a server sided programing language to do this in. Even if it did work with JavaScript you would end up running out of quota on the API before to long.
Google Analytics' EmbedAPI will allow you to display your Google Analytics via javascript, and users will be able to log in on page.
You will still need to get your clientAPI, but then users will be able to login independently.
The javascript code is described in the dev guide and a sample is below:
<script>
gapi.analytics.ready(function() {
// Step 3: Authorize the user.
var CLIENT_ID = 'Insert your client ID here';
gapi.analytics.auth.authorize({
container: 'auth-button',
clientid: CLIENT_ID,
});
</script>
The API limit should be no problem, its 50,000 calls per day.

Resources