Sonntag, 2. Oktober 2016

OracleJet with Google Cloud Endpoints and Google Cloud SQL

Introduction

After I did implement some basic parts of my Android application with Oracle Jet, I had the issue, that my Android application was keeping all the needed information locally on the Smartphone. So my next goal was to implement a REST services which have functions to create and read existing information.

Part 1: SignIn with Google

Since I didn't want unauthorized access to my future REST services I have been first thinking about how to make this access happen. I didn't want my users to remember another password, so I decided to pick the Google Login, which should secure my future REST services.

Let me explain the steps real fast

  1. The webapplication is asking for the users request token, which can be later used to authenticate the user. Remember that you need a client_id for your webapplication/smartphone app and have to send that with your request.
  2. Google is showing a popup to the user, which is asking him to identify himself by using his username and his password.
  3. After successful identification of the user, authorization code is being sent to the webapplication
  4. This authorization code is being sent by the webapplication to Google again.
  5. In exchange the webapplication is receiving the token, which contains basic information (email, name, pictureurl, ...) about the user and how long the token is valid.
  6. The token is being used by the webapplication to make all future REST service requests to the Google Cloud Endpoint. The Google Cloud Endpoint is validating the token, which ensures, that only authenticated users have access to my REST services. Currently I don't have an authorization. Everybody is allowed to user all REST services.




Part 2 - Oracle Jet with Google Cloud Endpoints and Google Cloud SQL



It was important for me to use some standards like JPA or MySQL on Google Cloud Endpoint side, cause this will make it easier for me to migrate to another Cloud service, in case I should ever choose to leave the Google Cloud.


Conclusion

I had to do some reading to get into all the Google Cloud stuff. Now that I got my architecture running, it shouldn't be too hard to add extra functionality, or build other web applications, based on this architecture.

Keine Kommentare:

Kommentar veröffentlichen