Posts

How to connect via SSH (putty) to your vmware machine (Ubuntu) ?

Image
It was really a pain for me to work on Oracle VM, It won't allow you to use mouse or do copy-paste. So I decided to connect my local VM via SSH( Putty). Steps : 1.  In your VM box, Goto Settings -> Network ->Adapter 1 and select "Bridged Adapter" 2. In your Ubuntu Machine, Install "openssh-server"            sudo apt-get install openssh-server 3. Reboot the VM and Run "ifconfig" command in terminal and get "inet addr" of "eth0". 4. Open putty, Enter the IP address(IP of your VM machine ) , Select port as "22" and connection type as "SSH" and click on open button. 5. Enter your credential and you are done :)

Working of WSO2 Identity Server

Image
To enable OAuth support for your client application, First we need to register our application on WSO2 Identity Server. Step to register Client App on WSO2 IS : Goto Management Console and Enter your username and password. By default its “admin”. Click Main button and then OAuth in Manage menu. Click on the Register New Application link on the OAuth Management page. Select OAuth 2.0 as the OAuth Version . Enter Application Name and your Callback Url . For this app to work use http://localhost:8080/playground/oauth2client .       5. Click on Add button , you will see your application under the OAuth                Management Page. Click on the WSO2 application and copy the Client ID, Client Secret, Access Token URL and Authorize URL. We need these values for our web app. You are done with the registration part..!!! Sample App wi...

Setup of WSO2 Identity Server on Windows 7

Image
What is WSO2 Identity Server ? WSO2 Identity Server is an enterprise-ready, fully-open source, lean, component-based solution for facilitating security and provides secure identity management for enterprise web applications, services, and APIs by managing identity and entitlements of the user securely and efficiently. It helps improve customer experience by reducing identity provisioning time, guaranteeing secure online interactions, and delivering a reduced single sign-on environment. WSO2 Identity Server decreases identity management, entitlement management, and administration burden by including role-based access control (RBAC) convention, fine-grained policy-based access control, and SSO bridging. Downloading the product : In your Web browser, go to http://wso2.com/products/identity-server. If you are a new user downloading WSO2 products for the first time, register and log in. Once you are logged in, click the Binary button in the upper right corner of ...

How to retrieve Facebook profile using Apache Oltu

Image
This tutorial shows you the basic of OAuth using Apache Oltu (Formely known as Apache Amber). We have created a Java Web Application that authenticates the user to Facebook via OAuth 2.0 and retreive the protected resources from Facebook. Setup : SSL enabled Tomcat Server as we have deployed our Web Application on tomcat. Click here for instruction on How to enable SSL on Apache Tomcat 7.0 Registered Facebook Application. Check here for instruction on How to register App on Facebook. Download the OltuClientFB Application from the GIT repository. If you are using Maven then add below dependency or download Apache Oltu client jars : <dependency> <groupId>org.apache.oltu.oauth2</groupId> <artifactId>org.apache.oltu.oauth2.client</artifactId> </dependency> Run the Project : Check out the project from the above URL, import into the eclipse and Run as a Server. Navigate your browser to https:...

How to register App on Facebook

Image
Steps to create Apps on Facebook : Login to your Facebook account and then Goto https://developers.facebook.com/ and then click on Apps tab. Check below screenshot : Registration Page Enter the Display Name. This is required.  Enter Namespace. (Optional) Choose a Category and then click on Create App button. After verifying captcha It will show you the App ID and App Secret which is nothing but ClientId and ClientSecret . Check below screenshot : Select “Settings” and then click on “Advance” tab. Scroll down and enter your callback URL in “Valid Oauth redirect URIs” and then click on “Save Changes button to save your apps. Congratulation!!! You have created your Apps on Facebook.

How to setup of WSO2 Identity Server on windows

Image
What is WSO2 Identity Server ? WSO2 Identity Server is an enterprise-ready, fully-open source, lean, component-based solution for facilitating security and provides secure identity management for enterprise web applications, services, and APIs by managing identity and entitlements of the user securely and efficiently. It helps improve customer experience by reducing identity provisioning time, guaranteeing secure online interactions, and delivering a reduced single sign-on environment. WSO2 Identity Server decreases identity management, entitlement management, and administration burden by including role-based access control (RBAC) convention, fine-grained policy-based access control, and SSO bridging. Downloading the product : In your Web browser, go to http://wso2.com/products/identity-server. If you are a new user downloading WSO2 products for the first time, register and log in. Once you are logged in, click the Binary button in the upper right corner of ...

How to substitute dynamic placeholder in properties file

This blog will explain you how can you use replace placeholder with original value in properties file. To achieve this task we will you Java API MessageFormat . Suppose you have properties file named "welcome.properties" having message : welcome=Hi {0} , Welcome to {1} Sample :  import java.io.File; import java.io.FileInputStream; import java.text.MessageFormat; import java.util.Properties; /**  * @author abdul  *  */ public class DynamicPlaceholder { /** * @param args * @throws Exception  */ public static void main(String[] args) throws Exception { File propFile = new File("D:\\juno\\Practise\\src\\com\\waheed\\dynamic\\placeholder\\substitution\\welcome.properties"); Properties props = new Properties(); FileInputStream stream=new FileInputStream(propFile); props.load(stream); String message = props.getProperty("welcome");                // Here the {0} and {1} will be substi...