Google Analytics Embed API with Server Side Authorization - Firebase Hosting - google-analytics-api

I completed the basic setup for Google Analytics and inserted the tracking code into my webpage(s). I can log in to analytics.google.com and see historical data just fine.
I have an admin page on my website where I want to display Google Analytics information to several users automatically (no additional logon req'd) and read that this is possible using the Embed API with Server-side Authorization.
I followed the instructions and created a Service Account that shows up under Service account keys in my Google API Manager portal. I also successfully ran 'sudo pip install --upgrade google-api-python-client' on my Cloud9 IDE and pushed the change to my hosting provider, Firebase, i.e. 'firebase deploy'. Lastly, I located and pasted my Analytics View ID in to the code sample provided with the Demo/Setup. My page is served with <!DOCTYPE html> declared.
I can't get it to work. Browser console says:
Uncaught TypeError: window.google.load is not a function
I am thinking that I am not invoking the get_access_token() in that Python module. In other words, I am thinking that server-side scripting is not supported with Firebase hosting.
Anyone know if and how to get Google Analytics Embed API with Server Side Authorization running with Firebase hosting?

This is not exactly a direct answer to your question, but rather an alternative solution to this problem. At least I’m using approach.
You can use Google Design Studio to build and embed amazing analytics and BI dashboards anywhere you like (also on your Admin website). But even easier would be to use Google’s authentication (via gmail) to provide access to select dashboards directly, as Google’s authentication and authorisation is likely more secure that your website’s.

Related

Unable to run Echo Bot Google Messaging API. Doesn't reply to "card", "carousel", "chips" strings

I just started Google Messaging APIs 3-5 days ago and couldn't figure out what did I go wrong. I already sent/asked this issue to Google's Support page.
Project is under my generic google account. I created a Service Account under this project for info#ourdomain.com and added it as a Project > Editor role. Got this Json keys, uploaded them together with my python Echo Bot files.
Done registering my partner account as well (info#ourdomain.com) and got verified with the Project Number connected that's in my generic google account. I don't know if this is the right setup where my partner account and project ID are from different Google Accounts (info#ourdomain.com and generic#gmail.com, respectively).
Echo bot sample I used: https://github.com/google-business-communications/bm-python-echo-bot/tree/master/full_sample
Logs:
I'm very familiar with programming Google's services but was unaware of Business Messages until I saw your question (it's interesting, thanks).
There are a couple of references to "select the project that you registered for Business Messages".
Often Google enable non-GA|non-public APIs and other functionality (sometimes by injecting service accounts into the project's policy) by having users register Project IDs and Google accounts. I suspect that's what's happening here and the functionality is either blocked or not working entirely by your use of a different Project.
You may be able to gain more insight from the problem by checking logs. IIUC, an App Engine app is deploy and you should be able to gcloud app logs read --project=[[YOUR-PROJECT-ID]] (or gcloud app logs tail --project=[[YOUR-PROJECT-ID]])

google spanner and direct REST api calls

I'm trying to use spanner emulator and I followed the instructions reported here:
https://cloud.google.com/spanner/docs/emulator
to set it up.
I can use gcloud shell commands to create instance, database, tables, etc. and all works correctly.
But I am not able to use the Rest API directly to access the emulator, even though the google documentation reports it is possible not only to use google client libs to access the emulator, but also the rest api.
The first problem is that it is not clear if I have to use either the base URL
https://spanner.googleapis.com/
or
http://localhost:9020/
When I try with
http://localhost:9020/v1/parent=projects/local-project/instanceConfigs
I always returns and "Not found" message, which means the the Rest API ws are responding, but through gcloud commands I can manage such instance and project!
What am I wrong with?!
According to the official documentation :
Using the Cloud Spanner
Emulator
"The Cloud SDK provides a local, in-memory emulator, which you can
use to develop and test your applications for free without creating a
GCP Project or a billing account."
Therefore you should use the localhost (localhost:9020 for REST requests).
You should use http://localhost:9020 to access the emulator if you want to manually access the REST API, so you were on the right track there.
The URL should however be http://localhost:9020/v1/projects/test-project/instanceConfigs to list all instance configurations on the emulator. Use http://localhost:9020/v1/projects/test-project/instances to list all instances.

Google Sign in error 403 - Project marked for deletion

I've recently integrated play-silhouette 4.0.0 with Play 2.5 to handle authentication. I am allowing my users to login with Google and as such am using Silhouette's OAuth2 features. I am redirected to Google's authorization page properly but after pressing allow the app fails with
403 - Project marked for deletion
I have enabled the Google+ API in the developer's console and am requesting the scopes "profile email" from the service. I've also deployed the sample app and get the same error. The error codes listed by Google are not much help - anyone have an idea? I've been testing on my local machine.
I resolved this issue:
Create a new project in the Google Developer Console.
Enable Google+ API.
Create OAuth Credentials.
Perhaps I created the credentials before I enabled the API. Seems a bit silly order would matter. Hope this is helpful to someone else!

IONIC | Login Authentication using Active Directory

Is it possible to use authenticate user from mobile application using Active Directory credentials in IONIC? I have gone through many google, but could not find any thing specific to Active Directory.
Ionic Framework is a front end framework. You can authenticate by any means that's available from your backend API.
auth0.com offers a soultion that might work for your needs if you want to integrate against a pre-baked solution rather that writing your own. They have a library for Ionic Framework.
You can find github repo here: https://github.com/auth0-samples/auth0-ionic2-samples
Auth0 offers identity management as a service (authentication). The Ionic Framework library claims that you can integrate against:
Google,
Facebook,
Microsoft Account,
LinkedIn,
GitHub,
Twitter,
Box,
Salesforce,
Windows Azure AD,
Google Apps,
Active Directory,
ADFS
or any SAML Identity Provider
Keep in mind that your Active Directory server will have to be available to Auth0 in some way in order for the integration to work. This may not be appropriate if you're building a purely internal enterprise app.

How to access local mysql from chrome packages app

I am developing a chrome packaged app. There is already an VB application running with mysql. I want to access the same database but use chrome packaged app as client.
How to access local mysql server from chrome packages app using javascript ?
I am aware of IndexedDB.
You have two options:
Create a web service (e.g. some PHP pages) that talks to MySQL and allows your app to use it as a go-between
Write your own MySQL driver/communicator to communicate with it directly: http://developer.chrome.com/apps/socket.html
The first is the easiest and would take the form:
Your chrome app would use AJAX to communicate with the PHP pages (probably via "POST")
Your PHP pages would expect it to login, use SSL and then use a token to continue identification during a session
The PHP would have generic capabilities to do CRUD actions
The PHP would spit back JSON for the results
but the second option would make you a hero if you took the time to develop that and put it on sourceforge or github under a permissive open source license.