Showing posts with label ASDK .Net. Show all posts
Showing posts with label ASDK .Net. Show all posts

Thursday, January 21, 2016

How to configuration and test OAM Access SDK 10g + OAM 11g with Dot Net


Access SDK 10g Installation & Configuration with OAM 11g R2 PS2 

Purpose

  1. Install & configure ASDK 10g with OAM 11g R2 PS2 and test SSO using .NET ASDK API’s.

Environment

  1. OS: Windows 2008 Server SP2 (64-bit)
  2. DOT Net Framework: 4.0
  3. OAM: 11g R2 PS2 (11.1.2.2.0) running on OEL 5.9
  4. Access SDK: 10g (10.1.4.3.0+BP10, BP13+IP09 (Patch Number 18110352))

Installation
  • Download & Install Access SDK
  • Install ASDK using Oracle_Access_Manager10_1_4_3_0_Win64_AccessServerSDK.exe from oam_int_win_v17_cd1.zip
URL:       http://www.oracle.com/technetwork/middleware/ias/downloads/101401-099957.html

  • Access Gate Registration 


  • Download and install apply patch “18110352” from Oracle Support which is the BP13-IP09 (latest version of the ASDK for Win64).
  • Patch Output:

C:\Users\Administrator\Downloads\p18110352_10143_MSWIN-x86-64\AccessSDK\Oracle_Access_Manager10_1_4_ 3_0_BP13-IP09_Patch_win64_AccessServerSDK_binary_parameter>patchinst.exe
Please enter Installation directory:
C:\NetPoint\AccessServerSDK
--- Oracle Access Manager System install ---
Upgrading Access Server SDK from release 10.1.4.3.0 BP 10 to release 10.1.4.3.0.13-IP09 BP 13-IP09. Unloading files to C:\NetPoint\AccessServerSDK/unload-Oracle-10143013-IP09BP13-IP09-2564.
unloading 'include/obaccess_api_c.h'
unloading 'include/obaccess_api_mgd.h'
unloading 'oblix/config/np1014_sdk.txt'
unloading 'oblix/lib/access_api_mgd.lib'
unloading 'oblix/lib/access_flush.dll'
unloading 'oblix/lib/jobaccess.jar'
unloading 'oblix/lib/obaccess.dll'
unloading 'oblix/lib/obaccess.lib'
unloading 'oblix/lib/obaccess_api_mgd.dll'
unloading 'oblix/lib/obnlsrtl.dll'
unloading 'oblix/lib/obxmlengine.dll'
unloading 'oblix/tools/configureAccessGate/configureAccessGate.exe'
unloading 'oblix/tools/migration_tools/obmigratefiles.exe'
unloading 'oblix/tools/migration_tools/obmigratenp.exe'
unloading 'oblix/tools/migration_tools/obpdiff.exe'
Backing up old files to C:\NetPoint\AccessServerSDK/backup-Oracle-101430BP10-binary_parameter. backing up 'include/obaccess_api_c.h'
backing up 'include/obaccess_api_mgd.h'
backing up 'oblix/config/np1014_sdk.txt'
backing up 'oblix/lib/access_api_mgd.lib'
backing up 'oblix/lib/access_flush.dll'
backing up 'oblix/lib/jobaccess.jar'
backing up 'oblix/lib/obaccess.dll'
backing up 'oblix/lib/obaccess.lib'
backing up 'oblix/lib/obaccess_api_mgd.dll'
backing up 'oblix/lib/obnlsrtl.dll'
backing up 'oblix/lib/obxmlengine.dll'
backing up 'oblix/tools/configureAccessGate/configureAccessGate.exe'
backing up 'oblix/tools/migration_tools/obmigratefiles.exe'
backing up 'oblix/tools/migration_tools/obmigratenp.exe'
backing up 'oblix/tools/migration_tools/obpdiff.exe' C:\NetPoint\AccessServerSDK/backup-Oracle-101430BP10-binary_parameter/include: File exists
backing up 'include/obaccess_api_c.h'
backing up 'include/obaccess_api_mgd.h' C:\NetPoint\AccessServerSDK/backup-Oracle-101430BP10-binary_parameter/oblix: File exists C:\NetPoint\AccessServerSDK/backup-Oracle-101430BP10-binary_parameter/oblix/config: File exists backing up 'oblix/config/np1014_sdk.txt' C:\NetPoint\AccessServerSDK/backup-Oracle-101430BP10-binary_parameter/oblix/lib: File exists
backing up 'oblix/lib/access_api_mgd.lib'
backing up 'oblix/lib/access_flush.dll'
backing up 'oblix/lib/jobaccess.jar'
backing up 'oblix/lib/obaccess.dll'
backing up 'oblix/lib/obaccess.lib'
backing up 'oblix/lib/obaccess_api_mgd.dll'
backing up 'oblix/lib/obnlsrtl.dll'
backing up 'oblix/lib/obxmlengine.dll' C:\NetPoint\AccessServerSDK/backup-Oracle-101430BP10-binary_parameter/oblix/tools: File exists C:\NetPoint\AccessServerSDK/backup-Oracle-101430BP10-binary_parameter/oblix/tools/configureAccessGat e: File exists
backing up 'oblix/tools/configureAccessGate/configureAccessGate.exe' C:\NetPoint\AccessServerSDK/backup-Oracle-101430BP10-binary_parameter/oblix/tools/migration_tools: F ile exists
backing up 'oblix/tools/migration_tools/obmigratefiles.exe'
backing up 'oblix/tools/migration_tools/obmigratenp.exe'
backing up 'oblix/tools/migration_tools/obpdiff.exe' C:\NetPoint\AccessServerSDK/backup-Oracle-101430BP10-binary_parameter/include: File exists
backing up 'include/obaccess_api_c.h'
backing up 'include/obaccess_api_mgd.h' C:\NetPoint\AccessServerSDK/backup-Oracle-101430BP10-binary_parameter/oblix: File exists C:\NetPoint\AccessServerSDK/backup-Oracle-101430BP10-binary_parameter/oblix/config: File exists backing up 'oblix/config/np1014_sdk.txt'
C:\NetPoint\AccessServerSDK/oblix/config/np1014_sdk.txt: Permission denied C:\NetPoint\AccessServerSDK/backup-Oracle-101430BP10-binary_parameter/oblix/lib: File exists
backing up 'oblix/lib/access_api_mgd.lib'
backing up 'oblix/lib/access_flush.dll'
backing up 'oblix/lib/jobaccess.jar'
backing up 'oblix/lib/obaccess.dll'
backing up 'oblix/lib/obaccess.lib'
backing up 'oblix/lib/obaccess_api_mgd.dll'
backing up 'oblix/lib/obnlsrtl.dll'
backing up 'oblix/lib/obxmlengine.dll' C:\NetPoint\AccessServerSDK/backup-Oracle-101430BP10-binary_parameter/oblix/tools: File exists C:\NetPoint\AccessServerSDK/backup-Oracle-101430BP10-binary_parameter/oblix/tools/configureAccessGat e: File exists
backing up 'oblix/tools/configureAccessGate/configureAccessGate.exe'
C:\NetPoint\AccessServerSDK/backup-Oracle-101430BP10-binary_parameter/oblix/tools/migration_tools: F ile exists
backing up 'oblix/tools/migration_tools/obmigratefiles.exe'
backing up 'oblix/tools/migration_tools/obmigratenp.exe'

backing up 'oblix/tools/migration_tools/obpdiff.exe' C:\NetPoint\AccessServerSDK/backup-Oracle-101430BP10-binary_parameter/include: File exists
backing up 'include/obaccess_api_c.h'
backing up 'include/obaccess_api_mgd.h' C:\NetPoint\AccessServerSDK/backup-Oracle-101430BP10-binary_parameter/oblix: File exists C:\NetPoint\AccessServerSDK/backup-Oracle-101430BP10-binary_parameter/oblix/config: File exists
backing up 'oblix/config/np1014_sdk.txt'
C:\NetPoint\AccessServerSDK/oblix/config/np1014_sdk.txt: Permission denied C:\NetPoint\AccessServerSDK/backup-Oracle-101430BP10-binary_parameter/oblix/lib: File exists
backing up 'oblix/lib/access_api_mgd.lib'
backing up 'oblix/lib/access_flush.dll'
backing up 'oblix/lib/jobaccess.jar'
backing up 'oblix/lib/obaccess.dll'
backing up 'oblix/lib/obaccess.lib'
backing up 'oblix/lib/obaccess_api_mgd.dll'
backing up 'oblix/lib/obnlsrtl.dll'
backing up 'oblix/lib/obxmlengine.dll' C:\NetPoint\AccessServerSDK/backup-Oracle-101430BP10-binary_parameter/oblix/tools: File exists C:\NetPoint\AccessServerSDK/backup-Oracle-101430BP10-binary_parameter/oblix/tools/configureAccessGat e: File exists
backing up 'oblix/tools/configureAccessGate/configureAccessGate.exe' C:\NetPoint\AccessServerSDK/backup-Oracle-101430BP10-binary_parameter/oblix/tools/migration_tools: F
ile exists
backing up 'oblix/tools/migration_tools/obmigratefiles.exe'
backing up 'oblix/tools/migration_tools/obmigratenp.exe'
backing up 'oblix/tools/migration_tools/obpdiff.exe'
Copying files from 'C:\NetPoint\AccessServerSDK/unload-Oracle-10143013-IP09BP13-IP09-2564' to 'C:\Ne tPoint\AccessServerSDK'.
Copy command using is: 'xcopy /S /Y /R /K /F "C:\NetPoint\AccessServerSDK\unload-Oracle-10143013-IP0 9BP13-IP09-2564" "C:\NetPoint\AccessServerSDK"'. C:\NetPoint\AccessServerSDK\unload-Oracle-10143013-IP09BP13-IP09-2564\include\obaccess_api_c.h -> C: \NetPoint\AccessServerSDK\include\obaccess_api_c.h C:\NetPoint\AccessServerSDK\unload-Oracle-10143013-IP09BP13-IP09-2564\include\obaccess_api_mgd.h -> C:\NetPoint\AccessServerSDK\include\obaccess_api_mgd.h C:\NetPoint\AccessServerSDK\unload-Oracle-10143013-IP09BP13-IP09-2564\oblix\config\np1014_sdk.txt ->

C:\NetPoint\AccessServerSDK\oblix\config\np1014_sdk.txt C:\NetPoint\AccessServerSDK\unload-Oracle-10143013-IP09BP13-IP09-2564\oblix\lib\access_api_mgd.lib - > C:\NetPoint\AccessServerSDK\oblix\lib\access_api_mgd.lib C:\NetPoint\AccessServerSDK\unload-Oracle-10143013-IP09BP13-IP09-2564\oblix\lib\access_flush.dll -> C:\NetPoint\AccessServerSDK\oblix\lib\access_flush.dll C:\NetPoint\AccessServerSDK\unload-Oracle-10143013-IP09BP13-IP09-2564\oblix\lib\jobaccess.jar -> C:\ NetPoint\AccessServerSDK\oblix\lib\jobaccess.jar C:\NetPoint\AccessServerSDK\unload-Oracle-10143013-IP09BP13-IP09-2564\oblix\lib\obaccess.dll -> C:\N etPoint\AccessServerSDK\oblix\lib\obaccess.dll C:\NetPoint\AccessServerSDK\unload-Oracle-10143013-IP09BP13-IP09-2564\oblix\lib\obaccess.lib -> C:\N etPoint\AccessServerSDK\oblix\lib\obaccess.lib C:\NetPoint\AccessServerSDK\unload-Oracle-10143013-IP09BP13-IP09-2564\oblix\lib\obaccess_api_mgd.dll
-> C:\NetPoint\AccessServerSDK\oblix\lib\obaccess_api_mgd.dll C:\NetPoint\AccessServerSDK\unload-Oracle-10143013-IP09BP13-IP09-2564\oblix\lib\obnlsrtl.dll -> C:\N etPoint\AccessServerSDK\oblix\lib\obnlsrtl.dll C:\NetPoint\AccessServerSDK\unload-Oracle-10143013-IP09BP13-IP09-2564\oblix\lib\obxmlengine.dll -> C :\NetPoint\AccessServerSDK\oblix\lib\obxmlengine.dll C:\NetPoint\AccessServerSDK\unload-Oracle-10143013-IP09BP13-IP09-2564\oblix\tools\configureAccessGat e\configureAccessGate.exe -> C:\NetPoint\AccessServerSDK\oblix\tools\configureAccessGate\configureAc cessGate.exe C:\NetPoint\AccessServerSDK\unload-Oracle-10143013-IP09BP13-IP09-2564\oblix\tools\migration_tools\ob migratefiles.exe -> C:\NetPoint\AccessServerSDK\oblix\tools\migration_tools\obmigratefiles.exe C:\NetPoint\AccessServerSDK\unload-Oracle-10143013-IP09BP13-IP09-2564\oblix\tools\migration_tools\ob migratenp.exe -> C:\NetPoint\AccessServerSDK\oblix\tools\migration_tools\obmigratenp.exe C:\NetPoint\AccessServerSDK\unload-Oracle-10143013-IP09BP13-IP09-2564\oblix\tools\migration_tools\ob pdiff.exe -> C:\NetPoint\AccessServerSDK\oblix\tools\migration_tools\obpdiff.exe
15 File(s) copied
Error: could not execute the tool 'C:\NetPoint\AccessServerSDK\oblix\tools\migration_tools\obmigrate paramsg.exe' successfully
Starting default Language message patch process ...
--- Oracle Access Manager System install ---
Upgrading Access Server SDK from release 10.1.4.3.0 BP 10 to release 10.1.4.3.0.13-IP09 BP 13-IP09. Unloading files to C:\NetPoint\AccessServerSDK/unload-Oracle-10143013-IP09BP13-IP09-2668. unloading 'oblix/lib/jobaccess.jar'
Backing up old files to C:\NetPoint\AccessServerSDK/backup-Oracle-101430BP10-message_en-us. backing up 'oblix/lib/jobaccess.jar'
backing up 'oblix/lib/jobaccess.jar'
backing up 'oblix/lib/jobaccess.jar'
backing up 'oblix/lib/jobaccess.jar'
Copying files from 'C:\NetPoint\AccessServerSDK/unload-Oracle-10143013-IP09BP13-IP09-2668' to 'C:\Ne tPoint\AccessServerSDK'.
Copy command using is: 'xcopy /S /Y /R /K /F "C:\NetPoint\AccessServerSDK\unload-Oracle-10143013-IP0 9BP13-IP09-2668" "C:\NetPoint\AccessServerSDK"'. C:\NetPoint\AccessServerSDK\unload-Oracle-10143013-IP09BP13-IP09-2668\oblix\lib\jobaccess.jar -> C:\ NetPoint\AccessServerSDK\oblix\lib\jobaccess.jar
1 File(s) copied
Error: could not execute the tool 'C:\NetPoint\AccessServerSDK\oblix\tools\migration_tools\obmigrate paramsg.exe' successfully
Patch complete
Successfully applied default Language message patch!
Patch complete

Note: Ignore the highlighted warning in the patch update log.


  • Check Installed windows updates from control panel

  • Make sure Visual C++ redistributable packs for 2005, 2008 64-bit is installed. 


  • Sample Application code Access_API_Test.cs 


using System;
using System.Reflection;
using System.Collections; 
using Oblix.Access.Server; 
using Oblix.Access.Common; 
class Access_API_Test 
{
public static void Main(string[] args) 
Console.WriteLine("Initialize the configuration directory!");
String resourceString = "//pokuri.demo.com:7777/"; Console.WriteLine("Initialize the configuration directory!"); 
try 
{
String config = "C:/NetPoint/AccessServerSDK";
ObConfigMgd.initialize(config);
catch (ObAccessExceptionMgd ex) 
{
Console.WriteLine("Initialization Exception caught: " + ex.String); 
}
ObDictionary parameters = new ObDictionary();
ObResourceRequestMgd resource = new ObResourceRequestMgd("http",resourceString,"GET",parameters); 
if ( resource.IsProtected == true ) 
{
Console.WriteLine("Resource " + resourceString + " is protected ..." ); 
try 
{
ObAuthenticationSchemeMgd authnScheme = new ObAuthenticationSchemeMgd(resource);
if ( authnScheme.IsForm ) 
{
Console.WriteLine("Authentication is basic" );
ObDictionary credentials = new ObDictionary(); credentials.Add("userid","user.1"); credentials.Add("password","Abcd123");
ObUserSessionMgd user = new ObUserSessionMgd(resource,credentials); ObUserStatusMgd status = user.Status;
if ( !status.IsLoggedIn ) 
{
Console.WriteLine("User is not logged in"); 
}
user.Location = "127.0.0.1";
Console.WriteLine("User: " + user.UserIdentity + " is logged in..."); Console.WriteLine("User location is: " + user.Location);
if ( user.IsAuthorized(resource) ) 
{
Console.WriteLine("User is authorized"); 
else 
{
Console.WriteLine("User is not authorized"); }
else 
{
Console.WriteLine("Authentication is not basic" );
}
catch (ObAccessExceptionMgd ex) 
{
Console.WriteLine("Access Exception caught: " + ex.String);
}
else 
{
Console.WriteLine("Resource is NOT protected ... " );
}

}



  • Environment Variables:
    set CLASSPATH=%CLASSPATH%;.;C:\NetPoint\AccessServerSDK\oblix\lib set PATH=%PATH%;.;C:\NetPoint\AccessServerSDK\oblix\lib
    set OBACCESS_INSTALL_DIR=C:\AccessSDK64\NetPoint\AccessServerSDK 

  • Add obaccess_api_mgd.dll in Global Cache. Use below command.
    C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\x64>gacutil.exe –l

    C:\NetPoint\AccessServerSDK\oblix\lib\obaccess_api_mgd.dll
    Note: If gacutil.exe is not available in any of the folder, download and install Dot Net SDK for 64 –bit OS
  • Compile the C# code using below command. “access_api_test.exe” file will be generated
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\csc.exe           /reference:C:\NetPoint\AccessServerSDK\oblix\lib\obaccess_api_mgd.dll /out:C:\NetPoint\access_api_test.exe C:\NetPoint\access_api_test.cs


  • Run the code C:\NetPoint>access_api_test.exe

If every thing is good code should run and check if user is authenticated & authorized for protected URL.


Useful Link & Commands
  • http://oracle.developer-works.com/article/4628709/OAM+Access+SDK
  • http://msdn.microsoft.com/en-us/library/ms379563(v=vs.80).aspx
  • http://docs.oracle.com/cd/E11857_01/em.111/e18155/mgmt_console/policy_templates/configuring_orac
    le_amclient_machines.htm
  • Trace Error commands
    C:\Windows\System32>sxstrace.exe Parse -logFile:C:\Test.log -outfile:C:\test2.txt
    C:\Windows\System32>sxstrace.exe Trace -logFile:C:\Test.log
  • How to: View the Contents of the Global Assembly Cache
    C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\x64>gacutil.exe -l 

Hope this will be useful to some one out there.

-- Siva Pokuri.