How to do Google Sign-In in Meteor - authentication

I've tried various tutorials and links on how to get Google Sign-In to work in Meteor to no avail. How can I create a google sign in button on my login page that redirects to my user dashboard--using iron:router perhaps (and shows the persons name in the corner), and restrict the google emails to only .edu accounts?
Also as the admin of the page how would I be able to see the emails/names of all the people who have logged into my website? Is this done through Google Analytics?

Try adding the accounts-google package. You'll need to configure the Google sign in with the application key and secret. The easiest way to do this is to also add the accounts-ui package and using
{{> loginButtons}}
which will display detailed instructions on the steps to follow on the Google page. It will also save your app key and secret tokens appropriately.
Once this is done you'll be okay using the method
Meteor.loginWithGoogle()
as explained in the docs. It takes an optional array of options and a callback function
e.g
Meteor.loginWithGoogle({}, function(error){
if(error)
//Couldn't log in
else
Router.go('/dashboard');
})
Good luck

For Google Sign-in, I would recommend installing the accounts-entry package and configuring it from your browser:
install with latest meteor version
meteor add joshowens:accounts-entry
and for meteor version before 0.9 use
mrt add accounts-entry
For your dashboard redirection, review the documentation for that package on atmospherejs.com which demonstrates how to configure your dashboardRoute:
dashboardRoute: '/dashboard'
The iron-router package is a dependency of accounts-entry, so it will be installed as well.
Access the data by launching the MongoDB shell (after starting your app):
meteor mongo
Query for the accounts using the MongoDB shell:
db.users.find()
This is not handled via Google Analytics

Related

How to enable email and password signin provider for new firebase project using gcloud console or firebase tools CLI?

In the company I am working for, we provide a solution for other companies, and we want each company to have a separate instance of that solution, this includes a separate database instance, the database is Firebase, this choice of creating a new separate instance is required due to data privacy laws of the country we work in.
I am working on a script that when triggered by the new client SignUp, it starts the creation of new solution instance, including the creation of the new Firebase project, and I am using firebase-tools CLI and gcloud CLI.
The project creation happens correctly, and the admin account is created, the only remaining thing is to allow the admin to be able to login to the new Firebase project. This is usually done manually from the Firebase web console, by enabling a login provider, an Email&Password login provider in my case. This part of the process is so not automated, because I can't find the command that I should pass to Firebase-tools or gcloud ClI to enable a login provider in a Firebase project.
What is a command that you can pass to Firebase tools or to gcloud CLI , to change firebase project confguration to enable a signin provider ? signin usng Email&Passsword in this case .. Or is there a way to do it programmatically using Google client libraries ?
From looking at the REST API for the Google Identify Platform, I don't immediately see a call that shows email+password authentication. Unless I'm overlooking something this means it might not be possible to programmatically enable this provider through a public API.
From checking what the Firebase console does, it seems it handles the provider configuration through the https://identitytoolkit.clients6.google.com/admin/v2/projects/<projectid>/config endpoint, but I'm not sure that is part of the public API.
This seems possible now via Identity Toolkit API. The v2.projects REST resource has updateConfig method, and the Config contains SignInConfig which have the Email property.

Do I have to use browser login to use Google Sheets API from node instance?

I read all similar questions without arriving to the point.
I have a node instance and it runs on my "index.js" only in my local machine.
I have to take a cvs and put on new google sheet.
I have "credentials.json" in my project. Google say me "incorrect redirect_urls". But I cannot put a redirect url since it's a node script.
And I do not want to pass in a browser for a login. This because maybe tomorrow I will put the same script on a real server.
If you are trying to use the Google Sheep API I'm pretty sure you are not getting the results you want. ;)
Assuming you have enabled the Sheets API in you project, and you plan to use a server to deploy the application, then you need to configure you consent screen accordingly.
During development you can use localhost as a redirect URL, which will enable you to test the app.
You should have a read through this help article to correctly set up your OAuth credentials and consent screen for each type of project.

Google Drive API oauth 2 error

I managed to get the code runing to a point where i can upload and download files in my android app from google drive using the api. However i uploaded my app to Google Play and when a user installs it the first time the oauth 2 screen pops up and requires to select account(which is great) but when the user selects Google account the oauth screen just keep appearing and looping.
Did anyone encounter this before?
As stated in this thread, maybe you did not create credentials for your app. As described in this documentation, you must retrieve your SHA-1 keys for both the debug and production environments and add them in your credentials in the Google Developers Console.

Jhipster social login via Google

I added clientID and clientSecret (created in Google Developer console) to application.yml but I couldn't get it working. Any idea what is causing error 400. Error: redirect_uri_mismatch. I got http://127.0.0.1:8080 in Authorized JavaScript origins.
I did everything what is said in Google's tutorial, but no luck:
https://developers.google.com/identity/sign-in/web/server-side-flow#step_1_create_a_client_id_and_client_secret
You need to specify in your Google developers console the different redirect url you authorize. For you, you need to add http://127.0.0.1:8080 url.
Little tuto:
Connect to your developer console, click one the main menu
Select API management
Go to Identifiant and select your application, here JHipster
And add your url and save
Another thing that I had to do that wasn't mentioned clearly in the google developer link was to enable the Google+ API.
The various API's are accessible via the Library tab under the Dashboard.

How to check which errors I have in my Google API project?

I'd like to use this plugin with my Jekyll site to show page views for each post/ page. So I installed the plugin and set up a service account for Google data API. The site is generating but I get no data from Google Analytics for my page views (it shows 0). On the projects overview page in Google Developer Console I see that I'm getting errors. But I can't figure out how to check these errors?
Is there any way to see what these errors are?
How can I check if Google API is working at all on my site?
The problem was with permissions when you add a new user to Google Analytics account. I had only Read & Analyze, and it should be all four (Manage Users, Edit, etc.).