Showing posts with label OAM. Show all posts
Showing posts with label OAM. Show all posts

Wednesday, September 3, 2008

Oracle Support on VMWare / Virtualized environment

Oracle does not support Oracle Products installed on VMware as Oracle has not certified any of its products on VMware virtualized environments.

If the issue does not occur in a non-virtual deployment, you will be referred to work with VM Product Company.

For details, look on oracle metalink (https://metalink.oracle.com) for the following document:

Support Position for Oracle Products Running on VMWare Virtualized Environments

Doc ID: Note:249212.1 Type: ANNOUNCEMENT
Last Revision Date: 16-NOV-2007 Status: PUBLISHED

Friday, August 29, 2008

What does OBSSOCookie Contain ?

Access Server generates a session token with a URL that contains the ObSSOCookie. Single sign-on works when the cookie is used or subsequent authorizations in lieu of prompting the user to supply authorization credentials. When the cookie is generated, part of the cookie is used as an encrypted session token.

The encrypted session token contains the following information:

• The distinguished name (DN) of the authenticated user
• The level of the authentication scheme that authenticated the user
• The IP address of the client to which the cookie was issued
• The time the cookie was originally issued
• The time the cookie was last updated

If the user has not been idle, the cookie is updated at a fixed interval to prevent the session from timing out. The update interval is one-fourth of the length of the idle session timeout parameter.

Unencrypted ObSSOCookie data includes:

• Cookie expiry time
• The domain in which the cookie is valid
• An optional flag that determines if the cookie can only be sent via SSL

Can OBSSO Cookie be read ?

The ObSSOCookie is a secure mechanism for user authentication. When NetPoint generates the cookie, an MD-5 hash is taken of the session token. When the ObSSOCookie is used to authenticate a user, the MD-5 hash is compared with the original cookie contents to be sure no one has tampered with the cookie.

MD-5 is a one-way hash, so it cannot be unencrypted. The Access Server does the comparison by hashing the session token again and comparing the output with the hash of the token already present in the cookie. If the two hashes do not match, the cookie is corrupt. The system relies on the fact that if someone tampers with the session token, the hashes will not match.

Please Note: The single sign-on cookie does not contain user credentials such as username and password.

Wednesday, April 16, 2008

OAM ObSSOCookie Logoff JavaScript Code

You may use the following code to Delete ObSSOCookie (or any other) cookie to logoff from OAM.

<script type="text/javascript">
// this deletes the cookie when called

function LogoffOAM(){
Logoff('ObSSOCookie', '/', '');
}

function Logoff( name, path, domain ) {
if ( Get_Cookie( name ) ) document.cookie = name + "=" +
( ( path ) ? ";path=" + path : "") +
( ( domain ) ? ";domain=" + domain : "" ) +
";expires=Thu, 01-Jan-1970 00:00:01 GMT";

javascript:Confirm();

}
function Get_Cookie( name ) {

var start = document.cookie.indexOf( name + "=" );
var len = start + name.length + 1;
if ( ( !start ) &&
( name != document.cookie.substring( 0, name.length ) ) )
{
return null;
}
if ( start == -1 ) return null;
var end = document.cookie.indexOf( ";", len );
if ( end == -1 ) end = document.cookie.length;
return unescape( document.cookie.substring( len, end ) );
}


function closeWindow(win) {


win.open('','_parent','');

win.close();


}


function Confirm ()
{

window.location = "http://www.bhatiacorp.com";

}

function logoffRedirect ()
{
alert(" You are logged off.\n\n You will be redirected to Corporate Web Site.");
window.location = "http://www.bhatiacorp.com";
}



</script>

Wednesday, August 1, 2007

JUNIT Test Case for getting values from Oblix

============================
File: IDXMLUnitTest.java
============================

import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;


import junit.framework.TestCase;


public class IDXMLUnitTest extends TestCase {


public IDXMLUnitTest(String name) {
super(name);
}

/* (non-Javadoc)
* @see junit.framework.TestCase#setUp()
*/
protected void setUp() throws Exception {
super.setUp();
}

/* (non-Javadoc)
* @see junit.framework.TestCase#tearDown()
*/
protected void tearDown() throws Exception {
super.tearDown();
}

public void testSearch()
{
String url = "http://localhost:8081/identity/oblix/apps/userservcenter/bin/userservcenter.cgi?wsdl";
System.out.println(url);

String authen = "adminpassword";

String xml = ""+authen+"" +
"cn=RajnishBhatia,o=NetscapeRootmail" +
"
";

System.out.println("\n\n"+xml+"\n\n");


try
{

URL u = new URL(url);
System.out.println(" url .... " + url);
URLConnection c = u.openConnection();
HttpURLConnection conn = (HttpURLConnection) c;
conn.setRequestProperty("Content-Type", "text/xml");

conn.setDoInput(true);
conn.setDoOutput(true);
conn.setRequestMethod("POST");
OutputStream out = conn.getOutputStream();
OutputStreamWriter wout = new OutputStreamWriter(out, "UTF-8");
wout.write(xml);
wout.flush();
out.close();

if(conn.getResponseCode() == 200) {
InputStream in = conn.getInputStream();
DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = builderFactory.newDocumentBuilder();
Document document = builder.parse(new InputSource(in));
Element rootElement = document.getDocumentElement();
NodeList parentNode = rootElement.getElementsByTagName("ObValue");
Node node = parentNode.item(0);
System.out.println(" ...value ... " +node.getNodeName() + " .... " + node.getFirstChild().getNodeValue());
in.close();
}else
{
System.out.println(" conn.getResponseCode()" + conn.getResponseCode()) ;
}

conn.disconnect();
}catch(Exception e)
{
System.out.println("Exception ......." + e.getMessage());
}
}
}
==================
Result
==================
rajnishbhatia19@hotmail.com

courtesy:Dilip Nimse

Thursday, July 26, 2007

Calling A Web Service in .NET without adding a web reference

If you ever need to reach a web service and use its output in your codewithout adding a web reference in your project, here is the code you can use:

I'm posting a code I used to connect to Netpoint Oblix CoreID Oracle Access Manager and retrieve values from it. This is a console app sample. You can use the same code in your web apps as well.
=====================================================
File Program.cs
=====================================================
using System;
using System.Xml;
namespace IDXML
{
class Program
{
private const string m_InFileName ="C:\\Projects\\IDXML\\IDXML\\InputXML.xml";
static void GetOblixData(string URL)
{
try
{
XmlDocument xDoc = new XmlDocument();
xDoc.Load(m_InFileName);
Byte[] bdata =System.Text.Encoding.ASCII.GetBytes(xDoc.OuterXml);
System.Net.WebClient wc = newSystem.Net.WebClient();
wc.Headers.Add("Content-Type","text/xml");
Byte[] bresp;
bresp = wc.UploadData(URL, bdata);
string resp =System.Text.Encoding.ASCII.GetString(bresp);
//Console.WriteLine(resp);
XmlDocument xresp = new XmlDocument();
xresp.LoadXml(resp);
XmlNodeList elems =xresp.GetElementsByTagName("ObValue");
XmlNode x = elems[0]; // Assuming One / Picking First - ... If more then just loop
Console.WriteLine(x.InnerText);
}
catch(Exception ex)
{

Console.WriteLine(ex.Message+""+ex.StackTrace);
}
}

static void Main(string[] args)
{
try
{

GetOblixData("http://localhost:8081/identity/oblix/apps/userservcenter/bin/userservcenter.cgi?wsdl");
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
}
}
}


=====================================================
File Input.xml (I used this file to provide input xml sothat we can change it. You can simply prepare an xml in your code or read from somewhere else).
=====================================================

<?xml version="1.0"?>
<SOAP-ENV:Envelopexmlns:SOAP-ENV="http://schemas-xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<oblix:authenticationxmlns:oblix="http:/www.oblix.com" type="basic">
<oblix:login>admin</oblix:login>
<oblix:password>password</oblix:password>
</oblix:authentication>
<oblix:request application="userservcenter"function="view" version="NPWSDL1.0"xmlns:oblix="http://www.oblix.com">
<oblix:params>
<oblix:uid>cn=RajnishBhatia,o=NetscapeRoot</oblix:uid>
<oblix:attrName>mail</oblix:attrName>
</oblix:params>
</oblix:request>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
=====================================================
Result
=====================================================
rajnishbhatia19@hotmail.com