Tuesday, March 18, 2014

How to set permanent IP in Ubuntu ?

Steps :

*) Open the interfaces file :
          sudo vi /etc/network/interfaces

If you are using DHCP you will see the following lines :
          auth eth0
          iface eth0 inet dhcp 


*) To make it static, Change the line iface eth0 inet dhcp to iface eth0 inet static and add the following just below it:

address 10.35.34.209 (IP address that you need to set)
netmask 255.255.255.0 (Default mask which in this case is the default class c subnet)
gateway 10.35.34.1 (Typically your router’s IP address)
network 10.35.34.0 (The network that this machine is running on)
broadcast 10.35.34.255

Here is a screenshot of how it should look below :


*) Once you save this file you need to restart your networking service.
       sudo /etc/init.d/networking restart
or
       sudo service networking restart

Note :
 /etc/init.d/networking restart command is deprecated on new debian and ubuntu, So in such case you can use :
            ifdown eth0 && ifup eth0

Friday, March 14, 2014

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

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 :)



Friday, February 14, 2014

Working of WSO2 Identity Server

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 :

  1. Goto Management Console and Enter your username and password. By default its “admin”.
  2. Click Main button and then OAuth in Manage menu.
  3. Click on the Register New Application link on the OAuth Management page.



  1. 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.





  1. 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 with WSO2 Identity Server :

Download the sample app from here and host it in Tomcat. You can see the app running at http://localhost:7070/playground.
  1. Click on Import Photos






  1. Select the Grant Type as “authorization code”. Enter Client Id , Authorize Endpoint that we got while registering our Application. Scope is Optional and click on Authorize.


3. WSO2 Identity Server requests access to noscope, After login click on Approve.


4. You will get authorization code, Now enter the value for the Access Token Endpoint and Client Secret and click Get Access Token.

5 . Once you get access token, Click on “Get Photo”.




How TOPT Works: Generating OTPs Without Internet Connection

Introduction Have you ever wondered how authentication apps like RSA Authenticator generate One-Time Passwords (OTPs) without requiring an i...