Retrieve Google Calendar owner's email address - google-calendar-api

Is it possible, with the Google Calendar API / Zend Gdata, to get the user's google email address, after he successfully authenticated with AuthSub and I have an access token?
I have a problem with some users having multiple Gmail and Google Apps accounts, and then not remembering which one they've used to Sync with my service and having the impression that the sync doesn't work. I'd like to display them the Google Account they have first authenticated with.

Have you tried the experimental settings API? It looks like it returns the user's name and email address in the author section.

Related

How to use google analytics Api without using google account

we are provide saas plugin to our customers, we need to get events for each customer's website without creating seperate GTM container and GA property , All the process will takes place in background.
There should be no login requried ,insted we will send the username and password to Google Aalytics through code(JavaScript).
so we need to use google analytics Api without google sign in
is there a way to do this
we are provide saas plugin to our customers, we need to get events for each customer's website
If you want to connect to the analytics accounts for your customers websites they you need to be authorized to access their private data.
no login requried ,insted we will send the username and password to Google Aalytics through code(JavaScript).
You can not login to anyones google account using login and password that was called client login and google disabled that in 2015. You will need to use Oauth2 request consent and gain authorization to access their private data.
so we need to use google analytics Api without google sign in
Sign in is authentication, the Google analytics api operations on authorization. The user needs to consent and grate you authorization to access their data.
is there a way to do this
No you can not access private user data without the owner of that data authorizing your access to that data.

Change email address of user who signed it with Google

When using Firebase Auth, should I allow users to change their email address if they originally authenticated with Google?
How would I then handle this, when the user will not have a password and will not be able to log in with this new email address but will have to use the Sign In With Google option and log in with their original google email address.
You can link multiple authentication providers to one account - see the docs here.
This way, they can choose to sign in any of the linked providers on another device or on the original device (e.g. after they've deleted and re-installed the application).

How can I access the Google Calendar API through Google Actions and Dialog Flow

Referencing this post
, I tried to create an access token for my Google Actions. I enabled Google sign in, and end up with a user-id. The top post says "You can combine this with a web- or app-based Google Sign-In to get their permission to access OAuth scopes if you need to access Google's APIs" but I honestly have no idea how to do that. What I'm trying to do is get an access token from Google Actions/ Dialog flow to send to my server-end code in order to make a successful API POST request to Google Calendar API.
The post you reference that points to another StackOverflow answer that discusses the approach. It basically says that you need to combine two things to do what you want:
You use Google Sign In on a web page to let the user authorize you to access the calendar on their behalf.
You probably should use the hybrid flow so the access/refresh tokens are only handled on the server side - not in your web client.
Your server will store the access/refresh tokens in some way so you can use them as part of your Action later.
You will use Google Sign In for Assistant to authenticate the user when they connect through the Assistant and determine if they have already authorized you to access their calendar. If they have, you'll be able to get their access/refresh tokens out of your store and access their calendar.
You can't do it completely through AoG/Dialogflow because there is no way for the user to grant OAuth permissions to you by voice alone - this is why you need to direct the user to a web page for them to grant you permission to access their calendar.

Google Calendar Api not returning attendee name for directory contacts

I have built a web application that uses a service account linked to my own Google Account. We use Google Apps, so my Google Account is part of a domain. We have a server with shared contacts, so all of our clients are available as contacts for everyone. In my contacts, this group is called 'directory'.
The application retrieves events from the Google Calendar using the Google Api PHP client. It also retrieves attendees inlcuding all details for those attendees. But if the attendee is not within our domain, it will only retrieve the e-mail address. I also want to get the name for that attendee.
These names are in my contacts in the directory group. When I create an event and invite guests, I can retrieve these contacts and it will show the name and mail adress. But when retrieving the attendees via the API it does not show these names.
Is this a restriction of the API? Is there a solution for this?
I do not want to use the Contacts api with a non-service account, because I don't want to give permission everytime. It is not possible to use the Contacts api with a service account as far as I know.
You are correct that a service account won't work with the Contacts API, however you don't have to authorize it every time you use it. You can provide domain-wide delegation with two-legged OAuth 1.0a instead of 2.0. See https://developers.google.com/google-apps/contacts/v3/index#authorizing_requests_to_the_+wzxhzdk8+_service and https://developers.google.com/accounts/docs/OAuth#GoogleAppsOAuth.
Depending on your setup, you can also use the three-legged OAuth 2.0 flow for a single administrator account and save the refresh token. This would let you re-use that authorization without requiring explicit permission again.

How can I get my friends from Facebook in my application?

I am developing an ASP.NET application.
I implemented Facebook API in my application now I want to access email addresses of my friends on Facebook.
I successfully connected Facebook with my application, but when I use FacebookApi.friends.GetList() it will give only friends userids then I will fire a FQL for each friend userid to access email but some time I got blank instead of email address.
Can someone help.
Which is best way facebook rest API or graph API?
The answer is almost certainly that one of the following is true:
The user hasn't shared an email address with Facebook
The user has placed you in a privacy group they deign to share their email address with
The user has set their privacy settings to not share their email address at all
If any of these are true, there's nothing you can do to resolve this short of asking your friends to change their privacy settings.
You need to ask for permission "email" to access email address of any user using your app, the reason why you are getting some email addresses is because few of Facebook users relatively have less restrictive privacy settings.

Resources