Posts

Spring Security with Custom REST Token and Dynamic Role Managment

Image
What is Stateless Authentication When working web applications in java we usually keep authentication information or user identity inside the session scope. which is unique to the user.  this works well if you have one single server.   Fully functional code available at below repositoty https://github.com/trvajjala/spring-rest-template.git when load on the server increase we do scaling out (also called horizontal scaling ) means we will add multiple servers with  the same application to serve the requests. in-front of this we introduce load balancer.  load balancer will uses round -robin algorithm kind of algorithms and divert user to different servers depending on the load.  here comes the issues. if the user authenticated with into one systems. and load on that system increase load balancer send request to another server which fails authentication and asks for credentials again which is bad user experience.  :( Ah !  we...

Deeper look of Multipart file upload ( RFC 1341 Specification)

Untitled Uploading large files as bytes stream from the standalone clients (like android device) using HttpURLConnection may cause memory issue or affects the performance. RFC 1341 specification gives you deeper look of how the multipart messages would work. In the case of multiple part file uploads, in which one or more different sets of data are combined in a single body, a "multipart" Content-Type field must appear in the entity’s header. you can find the utility class here. The body must then contain one or more "body parts," each preceded by an encapsulation boundary, and the last one followed by a closing boundary. Each part starts with an encapsulation boundary, and then contains a body part consisting of header area, a blank line, and a body area. Thus a body part is similar to an RFC 822 message in syntax, but different in meaning. Below is the visual representation of how the multipart data is needs to be creat...

Converting Author to Public instance in Magnolia

Image
Converting Author to Public instance in Magnolia  Change admin flag to false under    config → server Change role privileges for the anonymous role under Security → Roles Add ACL to anonymous role for website section → click on save Choose your website main page here Add ACL to anonymous role for URL section → click on save (You can add complex rules here; this is simplest way to convert into public instance) To verify anonymous privileges go to tools → Permission List

Liferay Portal Development with Eclipse

Image
Prerequisite Following software required to develop liferay portals 1. make sure JDK 6 or above  installed in your machine 2. get the Eclipse kepler version from https://www.eclipse.org/downloads/index-developer.php?release=kepler 3. following liferay archives download from below link                  i) bundle with tomcat v6.2                  ii) plugin SDK v6.2 https://www.liferay.com/downloads/liferay-portal/available-releases NOTE : liferay plugin SDK has it own way of development environment which uses ANT as build tool. hence i would recommend not to use maven for liferay development. Development Environment Setup 1.Launch eclipse and create eclipse workspace 2.Install liferay plugin for eclipse using http://releases.liferay.com/tools/ide/latest/milestone/ 3.Extract life...