Google accounts come with a pretty nice profile already, and since all Android phones connect to that profile for most of the google services. I'd like to add an option to my application to simply register with my application using your google profile on the phone. Not only would I have access to information like email address, name, aliases, but also profile images people use on google services.
Which Google API provides me access to that? Is there something in the Android API's that already provides this that I'm missing? I'm not just looking for authentication, as with OAUTH, but access to the profile information as well.
Are there any existing libraries I can use?
Turns out there is a way to get access to the google profile(s) the user has:
http://code.google.com/p/google-api-java-client/wiki/AndroidAccountManager
That's awesome.
Related
I haven't found anywhere in the Google's Android Management API any alternatives to using Google Cloud as its backend.
For users who have hard requirements against using Google Cloud or if it's unavailable in your physical location, does Google provide alternatives?
For context, Apple's take on this is that infrastructure is provided by the user itself and there is no "middle man".
The alternative option that Google provides is the use of Google Play Console. It allows users to use 3rd-party identity service by linking managed Google Play Accounts with the user’s existing identity accounts.
Also, since this is not tied to a user’s existing domain, creating more than one Enterprise for a single organization is possible.
Please refer to this link for additional information regarding this matter.
I am creating an application that uses google drive api, and requires authentication of a google account. The example on the quick start for using drive api for android uses google sign_in where user would be required to choose an account from the google accounts already added on the phone.
I dont want user to choose there own account. I want to add the account the api would be used in from code, such that files would be accessed from my own specified accounr not that of the user of the app. But I cant seam to find any sign_in or authentication form apart from the case when user is to choose an account.
Please can this be done? And if so how?
Answer would be simple No, you can do that but you have to use different API than that of Google's one. Google will ask to choose from account as it is added in implicit intent.
I'd like to use SSO (Single Sign-On) for users of my app, but I don't understand how to apply it to my case.
To summarize, we have:
a database
a website
an iPhone app / an Android App
Currently, it's possible to create an account on the site, and then use the same credentials to connect from the mobile apps. All communications between mobile apps and server work through http requests.
To put it simply, I would firstly
be able to use Google accounts to authenticate users
offering Android users to choose one of Google accounts associated with their smartphone
I found several sources of information:
Google - Using OAuth 2.0 for Login
Android - Remembering Users
Unlike what I saw in some examples, I don't need to make request to Google services like Google Calendar or Tasks, I just want to authenticate the user.
Does someone could tell me what I need to do on the website and on the mobile app. Should I store information in my database? How to ensure that after authentication, all http requests from the mobile application are really from authenticated user?
Do not hesitate to ask me to clarify some points.
Thanks in advance
As OAuth is a standard for authorization and not for authentication, it doesn't support any direct method for this. However, most providers allow you to call an endpoint that returns the id of the logged in user. Google returns the id as part of the basic profile information. This step is described in the first article you already mentioned. There are multiple libraries available to simplify this step for you.
So for identifying a user you acquire his Google user id and store/match it in your database.
To get the user's id on an Android device, there's an even more simple way. Just use Google Play Services as described in its documentation. You can find the user id in the response to the call in the last section of the documentation.
Now there's still the problem that you have to send the user id from the device to your web server and verify that this call was issued by your app. Fortunately, Google has also built a method into Google Play Services for exactly this scenario. There's a blog post by Tim Bray at the Android Developers Blog about this.
I'm creating an app that will need users to create an account. (Like Facebook or Twitter would require you to.)
BUT, since it's an Android app, should/can I let them sign in with their Google Account using AccountManager or some other service? It'd be very helpful if they could just sign in to their Google account and their settings and other options would be saved to that account.
Main questions summed up:
Is it possible to let a user just use their Google account in my app?
If so, do I use AccountManager to have them sign in and save account information/settings?
What are other options?
Yes, you can get users to log into their Google Services using their Google credentials, for example, I have an app on Google Tasks and I use the Android AccountManager to let users authenticate themselves using their Google account on the android device (No need for users to enter their password!)
There are some really good examples to get you started:
This is an in-depth look into how you can authenticate based on the users Android credentials, has an example of how things work and how the UI should be: http://www.finalconcept.com.au/article/view/android-account-manager-step-by-step-2
This is an example of getting AccountManager to work with a Google service like Google Tasks: https://developers.google.com/google-apps/tasks/oauth-and-tasks-on-android
The last example is using the same concept for accessing the Google Picasa service: http://code.google.com/p/google-api-java-client/wiki/AndroidAccountManager
The other options you have is to have users manually enter their username/password. For that you have to use a third party authentication API (like signpost for OAuth) for them to log in.
In my tasks/todo application I provide users both options to sign in, using their android credentials or using third party authentication for users that want to log in using some other account (an account which is not enabled on that device)
Let me know if you have more questions
Although it is a new development, Google Plus Sign-in introduced as part of Google Play Services can also be used. More info can be found at Android developers blog. See example implementation from Banjo app
There seems to be a big limitation - The user need to have Google+ app installed on the device to use this.
Also this is a pretty good blog if someone is interested in implementing the solution.
#Soham gave you some very useful links but he didn't correct one major error: AccountManager is the entity that manages the accounts on your Android device - it has nothing to do with your google account! you can use google account and create a NEW account on your device using the AccountManager.
The rest you can learn from the links Soham gave you.
My company would like me to manage paid Android applications in Android Market but not have access to the linked google merchant account. This is a very reasonable request but there seems to be no way to accomplish this. According to google docs the same google account must be used for the market and merchant account therefore if I have access to one then I have access to the other.
How do other corporations deal with this? Am I missing something?
If the company uses google-apps (see here), it can create an account for you and revoke/grant the particular service.