I am working on Google OAuth for user to sign up(asp mvc application), I want to retrieve the user's family name and given name once they authorized the permission for my app, But if the user hasn't enable/join Google Plus, the call back api return me empty family name and given name, if use have Google Plus enabled, then I can get their family/given names,
So, Here is my question, is it possible getting google user's family/given name through OAuth without user have to enable Google Plus ?
var loginInfo = new ExternalLoginInfo();
loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync();
LoginInfo have family/given name properties but they are empty string.
Many thanks!
so happy I got the solution now, the solution is to add the specific scope(https://www.googleapis.com/auth/plus.login) in the request to google oauth, then if the user's google account hasn't got google plus enabled, it will prompt user to create google plus profile first then accept you app to access the user's google account/plus information.
google oauth ref:https://developers.google.com/+/web/api/rest/oauth
Related
I am using the Google Sign-In SDK for iOS.
I want to get the minimum possible user info from Google so I can then use it as part of my auth system - even just the Google ID would do. But whatever I try, Google tells the user that I'm requesting their email, name, profile picture and language preferences:
I've tried:
GIDSignIn.sharedInstance().shouldFetchBasicProfile = false
GIDSignIn.sharedInstance().scopes = []
But it crashes, because Google Sign-In requires you've defined the scopes (or set shouldFetchBasicProfile = true which basically means scopes = ["email", profile])
Any idea how to request less data?
So I am having some trouble figuring out how to implement a sign-in for my app using google oauth. Every example I see shows how to authentication the user, get their permissions and then start using the Google APIs.
I do not care about permission or using Google APIs. All I want to do is have the user sign-in to my app using google oauth instead of having to implement my own authentication system with user and passwords in the database.
After the user authenticates with their google account, then they can change settings associated with their account for my app. What is the flow i need to implement to achieve this?
How would I associated a google user with certain data defined in my own app's database? I have successfully implemented the authentication part but then what would I need to store in my DB to associate them with their actions and data. Would I need to use sessions? and then retrieve their Google+ ID, save it in the database and then use that to identify them in the database for later when they log in again?
any help is appreciated
Once the the server validates the access token, a user account can be created in the database, saving the Google ID along other user details (ID, email, name etc).
If your application also supports normal registration, and an account is already present for that user (matching email), then you can just fill in the (nullable) Google ID column in order to link the account(s).
I am working on implementing sign in with gplus in my website. I have added the following settings :
SOCIAL_AUTH_GOOGLE_PLUS_KEY = 'my-key'
SOCIAL_AUTH_GOOGLE_PLUS_SECRET = 'my-secret-key'
SOCIAL_AUTH_GOOGLE_PLUS_IGNORE_DEFAULT_SCOPE = True
SOCIAL_AUTH_GOOGLE_PLUS_SCOPE = [
'https://www.googleapis.com/auth/plus.login',
'https://www.googleapis.com/auth/userinfo.email',
'https://www.googleapis.com/auth/userinfo.profile'
]
Sign in is successful. I am able to get the following information about the authenticated user (Username,email,firstname,lastname).
How can I go about to get the company, country and phone numbers after signing in? Which scope should I use that will enable me to see this information?
Google plus asks for "placesLived" where the user enters which cities he has lived. I am not sure how to get the country from this information.
I am using a custom pipeline for the create user app.pipeline.user.create_user which has strategy,response and details as arguments. I don't see any of these fields company,country,phone numbers in the details or response received after sign in.
If you check People.get at the very bottom you will notice "try me". you can test the results that the API will bring back for the different scopes.
The scopes you are using should be sufficient to give you the information you require. The trick is that the user needs to have the information set to public. If I have not set my company name to public the API wont return the company name even if it is me that is Authenticated.
So my guess is you aren't getting this information back because your user hasn't set the information to public. This has nothing to do with your python login, Try and test things using that Try it function at the bottom of the documentation page.
I am currently developing an app using the Google places API..
https://developers.google.com/places/documentation/
I want to use the Events methods, so that a Place/Business owner can add events..
https://developers.google.com/places/documentation/actions#event_intro
However I obviously need to restrict it, so that only the Business owner can create events for their Business. Is there anyway of authenticating a user via a Google api, to confirm that they are the Place owner? I looked at Google+ however there is no reference to any 'Places' setup by that user in the people request.
Looks like this is possible now. The workflow would be the following:
Your user triggers a places search and selects a specific place in the result
Your user selects an option in your app to claim they are the owner of your place
Your user is redirected into an OAuth flow to Google Places where they login with their Google credentials
Once authenticated, your app is provided with an OAuth token for the user
Your app submits that token along with a Place reference to a Places API owner verification service
The Places API returns a yes/no as to whether the user concerned is the verified owner of the Place
Source - https://code.google.com/p/gmaps-api-issues/issues/detail?id=3894 - comment #3
Enjoy!
I'm currently using OpenID to allow users to login to my website using Google as a provider. I'm thinking about allowing users to use Facebook to login as well. When a user logs in with Google OpenID, Google sends the following data to my website about the user:
Full name
First name
Last name
ID
Gender
Language
Email address
I've done some quick searching, but I can't find a list of attributes that Facebook would provide with an Oauth login. What data does facebook provide by default, and what additional data can you ask for?
Here's the list of what I get when accessing https://graph.facebook.com/me:
id
name
first_name
last_name
link
username
about
work
education
gender
email
timezone
locale
verified
updated_time
If you look at https://developer.facebook.com they have a bunch of tools which let you poke around and test URLs.
Check out the Facebook Graph Explorer tool: https://developers.facebook.com/tools/explorer/
By default, this tool let's you query the Facebook graph with default permissions.
There's a button labelled 'get access token' which gives you the option to generate access tokens for every possible combination of Facebook permissions. You can then query the Graph with any set of permissions and see what data is available.