Google App Engine: Endpoints authentication with ID and password - google-app-engine

We have an HTML5 client accessing a Google Cloud Endpoints backend. We want to offer users a reasonable range of sign-in methods, e.g.: sign-in with an existing OpenID, or alternatively sign-up with an email and password. These seem like basic requirements to us! If there is a better alternative that does not restrict our audience, then we'd consider it.
We're encountering two problems: (1) it seems the Endpoints service will only authenticate Google accounts, and (2) we don't know how to support "sign-up with email and password" together with Endpoints.
Edited: We found that our requirements can work together with Endpoints, but we did not find any Python examples to help, or to support an OpenID provider. We created our own "email/password" authentication option and enable it in parallel with Google OAuth. Overall the documentation on authentication when using Cloud Endpoints is minimal. Documentation and examples are stronger for the newer "Mobile Backend" project.

You are right, at this point you can build an oAuth provider using the lib provided in app-engine but that requires your users to have an Google account. So to protect my API I had to build my own custom oAuth2 provider. I did this by using the python oAuthLib library (oAuthLib). They have an awesome doc that will guide you through. I also made a rough document on how I made it app engine specific. If interested please take a look at the link Blog page
I hope this helps.

Related

User authentication with Servlets on App Engine

I'm new to web dev, and trying to build an application using google app engine's java standard environment, which will require user authentication. I'd like to provide authentication which requires only a username and password of the user, as opposed to a phone number or social account.
As I look through the options listed in app engine's auth tutorial, if I'm understanding them correctly, none of them allow login without a phone number or social account? https://cloud.google.com/appengine/docs/standard/java/oauth/
If so, are there alternatives available while still using app engine? I've read some about 'web container managed authentication' but I'm not sure if its something app engine will support, or if its a full solution.
Is it possible/feasible to roll fully custom authentication in the app engine standard environment? As I search for custom authentication tutorials I see a lot of articles recommending against this, but it's not clear to me what the alternative is.
Thanks for any information
As it's mention on the OpenID Connect documents of Google Cloud, it's important for you and your users security to authenticate using well proven and debugged code. Google offers Firebase Authentication which let's users log in with an Email and password.
If you still want to implement the authorize part on your own, you can use your preferred web framework and probably it will have an authorizing process.
For example, in python you can use Django authorize system to provide users for a custom way to log in.
But, as I said before, I highly recommend you to use the Google APIs for authorizing as they are OpenID certificated.

Google Cloud Endpoints oauth

I am new to cloud programming and will be making a GAE app with Cloud Endpoints.
I would like to use Oauth, but for Microsoft accounts as well as Google accounts.
I am having a hard time finding a definitive answer in the docs. I have read posts that are 3-4 years old stating that Cloud Endpoints only supports Oauth with Google accounts, but is this still the case?
You can go to Choosing an Authentication Method. There is a section titled Auth0 which states:
Auth0 authenticates and authorizes apps and APIs regardless of
identity provider, platform, stack and device.
Auth0 supports a large number of providers and the Security Assertion
Markup Language specification. It provides backend services, SDKs and
user interface libraries for authenticating users in web and mobile
apps......
.....
This might be what you need. Hope this helps

Google Apps Marketpalce Migration

I have integrated my application with Google apps marketplace with old version of OpenID and getting the data from Google calendar by using Google calendar version 2 API. Now I need to integrate every thing to new version. I have confused a little bit as Google is providing various authentication and authorization process. I looked in to OpenID connect, JWT (JSON Web Token), Google calendar version 3 service account. May any one please help me out from this issue like that should I use to authenticate as well as for authorization. Thanks in advance.
https://developers.google.com/accounts/docs/OAuth2 gives a good overview on various ways to authenticate with Google APIs and when to use them. For instance JWT is useful when your application uses Google APIs to store/retrieve its own data i.e. not to access data of your application's user.
Also see https://developers.google.com/google-apps/calendar/auth

RestTemplate with basic authentication on Google App Engine

I have develop a Spring MVC Rest service on Google App Engine with Spring Security 3.1.
Since the service will be available only to my other apps, I have a basic authentication setup with predefined username and password.
Now, I have a client developed with RestTemplate. But I am not able to find a way to access my services securely with username and password, sent via RestTemplate.
I have gone through many articles, but most are using Apache HttpClient (not supported by google appengine).
SO, is there any alternatives to getting what i want on google appengine.
You can try the Basic Auth with URLFetch as this is supported by google, though you want to have the ssl enabled to for use Basic Auth.
You might want to see at this link, though not for appengine but should be good.
http://www.jpalace.org/docs/technotes/spring/rest-security.html

How to add Facebook/Twitter/LinkedIn login to Google App Engine project?

I've searched for solutions, but everything I can find seems mostly outdated.
We're using the Python API for GAE and creating login urls in the following manner:
users.create_login_url(continue_url, "Yahoo", "http://yahoo.com/"),
Which works fine for sites such as Google, Yahoo, Aol, Blogger, Flickr, etc... but we're aware that Facebook and Twitter don't work in this manner.
Can anyone show any examples of how to authenticate users on App Engine using Facebook, Twitter, and LinkedIn?
Thanks!
First, one has to register their application on Facebook and get an Application ID. Details:
Register here Facebook authentication overview
Then, I used the facebook python SDK, along with the facebook javascript api (which is the canonical way to do authentication with facebook). Here's a working example of authenticaion I used.
Direct link to the Facebook python SDK
Direct link to the Facebook Javascript SDK
If the service you want to sign in with doesn't support OpenID, you need to do it the same way you would on any other service: Set up your own sessions library, handle logins in a site-specific manner, and keep track of signed in user sessions using the session library.

Resources