Monday, November 5, 2012

Oracle Weblogic Server 11gR1 (10.3.6.0) Installation in Linux (64-Bit).


1. Run Installer as follows




2. Click Next


3. Select the directory path for Middleware and Click Next.


4. Uncheck the Security updates and Click Next.


5. Click on Yes.



6. Select Typical and Click Next


7. Click Next.


8. Click Next





9. Click Done.



10. Oracle Web Logic Server installation is sucessful.


Post your comments for any Quires....!!!!!

Cheers !!!!
Kiran Pokuri

Monday, October 8, 2012

Oracle Access Manager 11g R2 Access SDK



Prerequisites:

- Download OAM 11g R2 Access SDK from OTN and extract ZIP file and set CLASSPATH with all JAR files.
- Register New OAM 10g WebGate
- Add Host Identifier details
- Protect resource(In my case it's Welcome.html)
- Folder Structure needed for Access SDK Client
    - AccessSDKClient
                  - oblix
                        - lib
                            -ObAccessClient
                  - com
                       - spsolutions
                               - OAMAccessSDKTest.ava

- Navigate to C:\Oracle\Middleware\Oracle_IDM1\oam\server\rreg\client\RREG\rreg\output\<<WebGate>> Copy ObAccessClient.xml file and paste in lib folder as mentioned in above step.

Note: Make sure you add protected resource host name in Access SDK host Identifier list.

Code :
package com.spsolutions;

import java.util.*;
import oracle.security.am.asdk.*;

// Class to Check user authorization to a resource.
public class OAMAccessSDKTest {
   public static final String ms_resource = "//oracleiam.spsolutions.com:7777/Welcome.html";
   public static final String ms_protocol = "http";
   public static final String ms_method = "GET";
   public static final String ms_login = "<<userid>>";
   public static final String ms_passwd = "<<password>>";
   public static final String m_configLocation = "C:/OAMASDK";
   public static void main(String argv[]) {
          AccessClient ac = null;
      try {
          ac = AccessClient.createDefaultInstance(m_configLocation, AccessClient.CompatibilityMode.OAM_10G);
System.out.println("Configured Default Instance");
         ResourceRequest rrq = new ResourceRequest(ms_protocol, ms_resource,ms_method);
         System.out.println("Configured Default Instance  1");
         if (rrq.isProtected()) {
            System.out.println("Resource is protected.");
            AuthenticationScheme authnScheme = new AuthenticationScheme(rrq);
            if (authnScheme.isForm()) {
               System.out.println("Form Authentication Scheme.");
               Hashtable creds = new Hashtable();
               creds.put("userid", ms_login);
               creds.put("password", ms_passwd);
               UserSession session = new UserSession(rrq, creds);
               if (session.getStatus() == UserSession.LOGGEDIN)
               {
                  if (session.isAuthorized(rrq)) {
                     System.out.println("User is logged in and authorized for the request at level "       +session.getLevel());
                           String identity = session.getUserIdentity();
                           System.out.println("Identity --> "+identity);
                           // Setting up Session Variables
                           Hashtable sessionAttributes= new Hashtable ();
   sessionAttributes.put("userid", "siva");
   sessionAttributes.put("mobile", "1234567890");
   sessionAttributes.put("email", "siva@abcd.com");
   session.setSessionAttributes(ac, sessionAttributes);
                       
                           // Getting session variables
                          Hashtable attrs = session.getSessionAttributes(ac);
                           System.out.println("Session Attributes" + attrs);

                  } else {
                     System.out.println("User is logged in but NOT authorized");
                  }
               } else {
                  System.out.println("User is NOT logged in");
               }
            } else {
               System.out.println("non-Form Authentication Scheme.");
            }
         } else {
            System.out.println("Resource is NOT protected.");
         }
      }
      catch (AccessException ae) {
         System.out.println("Access Exception: " + ae.getMessage());
      }
      ac.shutdown();
   }
}

Thanks!!!

Friday, September 14, 2012

SSH Connection between the linux hosts


Hello  folks,

Here I would like to give steps to build a SSH connection between two Linux hosts.

Example hosts: abc.com & xyz.com

  1. Login to abc.com
  2. Navigate to "$cd .ssh/" directory from root. Incase the directory is not available simply create it in root "/".
  3. Execute the following command "ssh-keygen -t rsa"
  4. Change the permissions to "id_rsa.pub" file "chmod 600 id_rsa.pub"
  5. Do cat id_rsa.pub and copy the content.
  6. Create "authorized_keys" file in same directory. Do vi and paste the content. If file is already exist paste the content at bottom of the file.
  7. Create "authorized_keys" file in .ssh/ directory in remote host (xyz.com). Do vi and paste the content.
  8. Perform steps 1 to 6 in remote host (xyz.com) and copy the content in "id_rsa.pub" and paste it in "authorized_keys" file in remote host(abc.com).
  9. Execute the following command to check the SSH connection.
    1. Login to abc.com
    2. $ssh xyz.com (First time it will ask password to login xyz.com)
    1. Execute same command in xyz.com to check ssh connection to abc.com.
Hope this post will useful.
Feel  free to post your comments if you any question regarding this…

Cheers!!!