Nowadays google forms are the most convenient way of collecting information and when it comes to google forms, usually the recommended way is to have security enabled so the user needs to be logged in before submitting the form. But sometimes when we are conducting surveys that are not possible as we need to share…
Category: Programming
Spring Security integration with WSO2 Identity Server
Recently I did a small screen cast on “Spring Security integration with WSO2 Identity Server”. You can find all the resources I have used in the screencast bellow. Source code of the SDK : https://github.com/rnavagamuwa/spring-security-abac/tree/master/sdk The source code of the sample: https://github.com/rnavagamuwa/spring-security-abac/tree/master/sample Slide deck
Android : Generate Release/Debug Keystores
Generate Keystores To generate keystores for signing Android apps at the command line, use: $ keytool -genkey -v -keystore my-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000 A debug keystore which is used to sign an Android app during development needs a specific alias and password combination as dictated by Google. To create a…
Simple authentication service with AWS Lambda
When it comes to APIs, AWS comes to our mind instantly. We all have been using AWS EC2 for our back ends. With the new Serverless Computing concept, AWS has introduced their own serverless platform which is called AWS Lambda. AWS Lambda lets you run code without provisioning or managing servers. You pay only for the compute time you consume…
Correct file permissions for a website
Hi all, Today I’m going to talk about file permissions on a Linux environment. Setting file permissions on your Web server should be the first thing you do. Users and groups To put it simply, a user is an account that has access to the computer, and a group just is an identifier for a certain…
Embed Tomcat in your Spring web app
Well, today I’m going to tell something about Apache Tomcat. Apache Tomcat, often referred to as Tomcat Server, is an open-source Java Servlet Container developed by the Apache Software Foundation (ASF). Tomcat implements several Java EE specifications including Java Servlet, JavaServer Pages (JSP), Java EL, and WebSocket, and provides a “pure Java”…
Multithreading with POSIX Threads
Overview During my 8th semester at University Of Moratuwa, I have enrolled to this module called Concurrent Module and I thought of sharing the things I learnt. What is multithreading? Multithreading is the ability of a program or an operating system process to manage its use by more than one user at a time and…
Generate a client side java SDK for multiple APIs
Overview If you have read my last blog post then you already know what I’m going to tell you now. So if you haven’t read those yet please refer it before starting this tutorial. https://randikan.wordpress.com/2016/01/12/generate-client-side-code-using-swagger-codegen/ Prerequisites You need to have a clear idea about swagger codegen. If you need a single jar file as the output…
Generate client side code using Swagger Codegen
Overview Swagger provides a simple, powerful representation for you APIs. After creating an API what you need is a client side code to access the API. Swagger provides an open source product to do that. Swagger Codegen Swagger codegen is the tool that we are going to use for generating client side code. You can…
OAuth 2.0
Now a days APIs do a major role in software engineering, and accessing APIs from mobile devices are becoming very useful. So when it comes to that, OAuth2 is an excellent protocol for securing API services from untrusted devices. OAuth Roles There are four major roles defined in OAuth Resource Owner The resource owner is the…
Android Push Notifications with GCM – Server Side(JAX-RS)
If you are not familiar with GCM please refer this url to get an idea before starting this tutorial. Overview When you are sending a push notification from the server you need to know the device registration id first. Device registration ID can be stored when the device is registered. Here I assume you all know the…
Android Push Notifications with GCM – Client Side
Overview of Google Cloud Messaging As per google’s documentation “Google Cloud Messaging for Android (GCM) is a service that helps developers send data from servers to their Android applications on Android devices” Send a request to GCM from the device to register (with the google project number). GCM sends back the device registration ID. Device…