5.3.2 Implementing a Credential Mapping Interface Plug-In
Using the following scenario:
- An existing Web service,
myservice
, sited on http://www.abc.com/webservice, requires HTTP Basic Authentication. The username is “test
”, the password is “1234
,” and the realm is “myrealm
”. - After converting the Web service WSDL into the SALT
configuration file (using
wsdlcvt)
, add the<Realm>myrealm</Ream>
element to the endpoint definition in theWSDF
file.
Perform the following steps to implement a SALT plug-in interface:
- Write the functions to map the “
myrealm
” Oracle TuxedoUID/GID
tousername/password
on www.abc.com.- Use
Credmap_HTTP_Basic();
This function is used to return the HTTP username/password. The function prototype defined in
credmap_pi_ex.h
- Use
- Write the following three plug-in register functions. For more information, see Plug-In Register Functions
_ws_pi_init_P_CREDENMAP_TEST(char * params, void ** priv_ptr);
This function is invoked when the GWWS server attempts to load the plug-in shared library during startup.
_ws_pi_exit_P_CREDENMAP_TEST(void * priv);
This function is invoked when the GWWS server unloads the plug-in shared library during the shutdown phase.
ws_pi_set_vtbl_P_CREDENMAP_TEST(void * vtbl);
Set the
gwws_pi_map_http_basic
entry invtable
structurecredmap_vtable
with theCredmap_HTTP_Basic()
function implemented in step 1.
- You can also write the optional function:
_ws_pi_get_Id_and_Names(int * params, char ** ids, char ** names);
This function is invoked when the GWWS server attempts to load the plug-in shared library during startup to determine what library interfaces are implemented. For more information, see Plug-In Register Functions.
- Compile the previous four or five functions into one shared
library,
credmap_plugin.so
- Configure the plug-in interface in the SALT deployment file.
Configure the plug-in interface as shown in the example below:
Example 5-7 Custom Typed Buffer Plug-In Interface
<?xml version="1.0" encoding="UTF-8"?>
<Deployment xmlns="http://www.bea.com/Tuxedo/SALTDEPLOY/2007">
. . . . . . .
. . . . . . .
<System>
<Plugin>
<Interface
id=”P_CREDENMAP”
name=”TEST”
library=”credmap_plugin.dll” />
</Plugin>
</System>
</Deployment>
Parent topic: Programming Outbound Authentication Plug-Ins