Skip to main content

Posts

Showing posts from June, 2018

Golang oAuth2 Google Example for Web and API

Introduction 👉 The oAuth2 protocol has almost become a standard for securing websites and API services. Developers no longer need to store and manage userIDs and passwords for their users. Offloading the authentication to OAuth2 providers such as Google, Facebook, Linkedin, Github keeps the authentication with username and password, within those providers rather than passing through the developer’s application. This reduces the risk that an application will leak user credentials and puts more control in the user's hands on for managing authentication with their accounts. I wanted to provide this capability in my own apps and went looking for a pattern to use in Go. Typically when I’m on a hunt like this I find bits and pieces that I stitch together into a reference pattern. For this oAuth pattern most of the result I found referenced back to a couple limited examples on the google site. Then it happened, I stumbled on a fantastic write-up and sample app that covers every main po...

Golang - MVC Pattern API Interactions with Firebase Database

Firebase Database interactions from Go: API. Developers can use this API to access the Firebase database from Go applications. It support realtime event listeners yet, but supports all the data update and query capabilities a typical server-side application would need. Listing shows how to initialize a Firebase app in Go, and store a value in the database. Store and sync data in Firebase with Golang : The Firebase Real time Database, by definition, is a cloud-hosted database. This Firebase NoSQL cloud database is trending as the new go-to data storage concept. With this, data is stored as JSON, and not in the traditional format. Also, Firebase performs real time data synchronisation to every client that is connected. How does it work? The Firebase Real time Database lets you build rich, collaborative applications by allowing secure access to the database directly from Server-side code. Since I am describing how to implement a client of Firebase with Golang, first, we...