Configuring OAuth Support for Siebel REST Outbound Connections - 22.9 Onwards
The following procedure shows how to configure OAuth support for any outbound REST proxy business service.
To configure OAuth support for any outbound REST proxy business service
-
Create a Workspace and open it in Siebel Tools/Web Tools.
-
Import the swagger – open the API JSON file for the outbound REST service in Web Tools.
-
Verify that the proxy business service has been created. Check the method arguments for the business service where you want to configure OAuth support.
- Create a new filter business service; for example 'RESTFilterTesting' with methods, for example UpdateInput and UpdateOutput methods.
-
Add a script to the newly created Filter business service’s Service_PreInvokeMethod event handler for which you want OAuth support. For more information, see the following topics:
- Add Script for OAuth Support
- Sample Script
-
Configure Administration – Web Service -> Outbound REST Services screen with the above for Request Filter under Filters for the REST Service -> Service Methods that you need to inject these above parameters with the Custom Filter Service that you created (for example 'RESTFilterTesting') at step 4. Caution needs to be taken to add the Filter Service method (for example UpdateInput) used in the script, to make sure that the appropriate parameters get added to the input (Request)/output (Response) property.
- You can add appropriate script if required, to intercept the response
such as the script
below.
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { if(MethodName == "UpdateOutput" && Outputs!= null) { // write your script code here to update the response } return (CancelOperation); }
-
For the existing “Siebel XSL to XML Converter” business service, set the attributes shown in the following table. This will allow you to reference the Siebel XSL to XML Converter business service in the script.
Attribute Value External Use
Yes
Server Enabled
Yes
Hidden
No
-
After making these changes and adding the script in step 4, deliver the Workspace.
Here's a sample updated Request done by the Filter business service script:
> Value = > Type = - > Child property set #1 at level 1: - > Value = - > Type = url - > httpMethod = POST - > url = https://https://petstore3.swagger.io/api/v3/pet - > Child property set #2 at level 1: - > Value = - > Type = query - > query = - > Child property set #3 at level 1: - > Value = - > Type = body - - > Child property set #1 at level 2: - - > Value = - - > Type = Req2SwaggerPetstoreOpenAPI30:body - - - > Child property set #1 at level 3: - - - > Value = - - - > Type = ReqBody__SKIP__WRAPPER - - - - > Child property set #1 at level 4: - - - - > Value = - - - - > Type = pet - - - - > long_id = 512312459 - - - - > string_status = pending - - - - > string_name = kk5name123 - - - - - > Child property set #1 at level 5: - - - - - > Value = - - - - - > Type = category - - - - - > long_id = 11 - - - - - > string_name = categorykk5name - - - - - > Child property set #2 at level 5: - - - - - > Value = - - - - - > Type = ListOftags__Array - - - - - - > Child property set #1 at level 6: - - - - - - > Value = - - - - - - > Type = tags - - - - - - > long_id = 5 - - - - - - > string_name = tagskk15name - - - - - - > Child property set #2 at level 6: - - - - - - > Value = - - - - - - > Type = tags - - - - - - > long_id = 6 - - - - - - > string_name = tagskk25name - - - - - > Child property set #3 at level 5: - - - - - > Value = - - - - - > Type = ListOfphotoUrls__Primitive - - - - - - > Child property set #1 at level 6: - - - - - - > Value = - - - - - - > Type = photoUrls - - - - - - > string_elem__value = 55 - - - - - - > Child property set #2 at level 6: - - - - - - > Value = - - - - - - > Type = photoUrls - - - - - - > string_elem__value = 66 - > Child property set #4 at level 1: - > Value = - > Type = security - > Child property set #5 at level 1: - > Value = - > Type = misc - > serviceMethod = addPet - > Child property set #6 at level 1: - > Value = - > Type = header - > Authorization = tokentype 1234567890 - > Content-Type = application/json