Single sign-on in Spring Boot applications with Spring Security OAuth

This week I had to dig deeper into the world of Single sign-on. I learnt a lot of things about it from basic conceptual knowledge to how to setup your own Single sign-on server with Spring Boot. In this post, I will share my learnings with you. In case something is not clear please leave a comment and I will address it.

Continue reading “Single sign-on in Spring Boot applications with Spring Security OAuth”


5 Reasons I Should Wake Up Early

Last three years, one of my new year resolution is to start waking up early. And on each of the occasion, it only lasted few days. I have tried multiple times to wake up early in my life but each time I have failed miserably. I used to take pride in night outs — working the whole night hacking away stuff. Since, last three years I have become self-aware that staying up late in night and waking up late in the morning is not effective. It end up costing you more. So, in this blog I am writing 5 reasons I should wake up early. These are the reasons that resonates with me. Continue reading “5 Reasons I Should Wake Up Early”

Using wait-for-it with Oracle database docker image

Today, I was working with an application that uses Oracle as the database. We decided dockerize the application to make it easy for fellow developers to work with the beast. We found a working Oracle docker image by sath89. Oracle 12c Docker image is close to 5.7GB on disk so we are not talking about lightweight containers here :). Once image was dowloaded, running image was as easy as running the following command.
Continue reading “Using wait-for-it with Oracle database docker image”

Programmatically Generating Database Schema with Hibernate 5

Today, I was working with a code base that was using Hibernate‘s schema generation facilities to create the database schema for a customer on the fly. The application creates separate database schema for each customer. Then, depending on the client specific identifier it connects to the correct database. This blog will not talk about how you should design your application with multi tenant database. I will cover that in a future post. In this post, I will share the code snippet that helped me generate database schema with Hibernate 5. In this post, I am using MySQL database as an example. The same code snippet should also work with other RDBMS as well.
Continue reading “Programmatically Generating Database Schema with Hibernate 5”

What does Being A Traveller mean to me

Since last two years, I have started travelling in a meaningful way. For me travel is not about visiting all the places mentioned in a checklist or going by a fixed plan or doing adventurous sports because it is cool or taking a lot of selfies. I like my travel to be meaningful and enriching experience for both my body and soul. I like to sit in a local cafe, drink a cup of tea, and read a book. Travel to me is long walks around the unknown roads of the city. Travel gives me the opportunity to see the world with a fresh perspective. You learn a lot about city by talking to local shopkeepers and taxi drivers. Continue reading “What does Being A Traveller mean to me”

Adding copy to clipboard functionality in Angular application

Today, I had to work on an application that required copy to clipboard functionality. Below is a step by step tutorial that will help you add copy to clipboard functionality. The reason I had to implement copy to clipboard functionality is that with dnd-list copy feature gets broken so I needed a way to give user a copy functionality.

Angular version being used in Angular 5.

Step 1: Create Angular application

$ ng new myapp

Step 2: Install ngx-clipboard and ng2-toastr

$ npm install --save ng2-toastr ngx-clipboard

Step 3: Configure modules

In the app.module.ts, add ClipboardModule and ToastModule

import { ToastModule } from 'ng2-toastr/ng2-toastr';
import { ClipboardModule } from 'ngx-clipboard';
    imports: [
    declarations: [
    bootstrap: [AppComponent]
export class AppModule { }

Step 4: Add ngx-clipboard directive

Update app.component.html

<div class="col-11 p-2 lh-condensed">
      <h6 class="font-weight-bold">
        <div class="float-right">
          <i class="ft-chevron-down"></i>
          <div class="dropdown-menu">

Update app.component.html

  copyToClipboard() {
    this.toastr.success('Copied to clipboard', 'Success!');