0

We are migrating part of our web app to a native mobile app (iOS and Android). We store all user info in our own database, including authentication info (username & pwd). We have a REST API for use by mobile apps and are trying to implement that in Google Cloud Endpoints.

We use an API key for identifying the app.

We want to also authenticate each user. The app will request the username and pwd and then pass that through the REST API. Our backend will confirm (by looking up the username/pwd in the db) if the user is valid. Ideally, at this point we would return a JWT.

Can this be done? The GCE documentation talks about authenticating Google users, and Facebook users. We don't want that. We don't want to use Firebase (unless a custom mechanism can be set up to authenticate). We will manage accounts. We will check if the username and pwd provided (through the app) identifies a valid user.

In trying to use a backend based on Google App Engine Standard and ESPv2, the documentation states that IAP must be enabled. IAP appears to authenticate users in a way we don't want. We want to authenticate users based on the username and pwd they provide and that we manage. Can this be done?

Any pointers would be greatly appreciated. Thank you.

Mike Dee
  • 558
  • 1
  • 5
  • 13
  • Maybe these two links can help: [https://stackoverflow.com/questions/20088633/google-app-engine-endpoints...](https://stackoverflow.com/questions/20088633/google-app-engine-endpoints-authentication-with-id-and-password) and [https://sookocheff.com/post/appengine/cloud-endpoints/using-basic-authentication...](https://sookocheff.com/post/appengine/cloud-endpoints/using-basic-authentication-with-google-cloud-endpoints/) – JM Gelilio Nov 25 '20 at 05:27
  • Thanks. I think we have a general idea of how it works. That second posting provides a little insight into the mechanics. In short, we will: 1) have an authenticate API method where we pass in username and pwd that was entered by user, 2) authenticate() will verify the user has an account and return a JWT token, 3) all subsequent calls from the mobile client will need to include the JWT token in the HTTP header. It seems like GCE will know how to process the token...if placed in the appropriate header. We'll need to figure the specifics out. – Mike Dee Dec 01 '20 at 18:59

0 Answers0