{"id":179,"date":"2025-04-17T19:01:16","date_gmt":"2025-04-17T19:01:16","guid":{"rendered":"https:\/\/www.familie-kleinman.nl\/brain\/?p=179"},"modified":"2025-04-17T20:01:17","modified_gmt":"2025-04-17T20:01:17","slug":"oracle-wsm-jwt-and-custom-policies","status":"publish","type":"post","link":"https:\/\/www.familie-kleinman.nl\/brain\/index.php\/2025\/04\/17\/oracle-wsm-jwt-and-custom-policies\/","title":{"rendered":"Oracle WSM, JWT and custom policies"},"content":{"rendered":"<p class=\"\" data-start=\"228\" data-end=\"384\">This is the second post in a series on OSB, JWT and OWSM. In the <a href=\"https:\/\/www.familie-kleinman.nl\/brain\/index.php\/2025\/03\/30\/oracle-owsm-and-jwt-token-handling\/\">first<\/a> post, I explained how to implement JWT validation using the standard OWSM configuration.<\/p>\n<h2 data-start=\"228\" data-end=\"384\">Introduction<\/h2>\n<p class=\"\" data-start=\"386\" data-end=\"661\">However, there\u2019s a fundamental limitation to that approach:\u00a0 you can\u2019t create fine-grained access control \u2014 for example, allowing token X to access service Y, but not service Z. As long as the token is valid, it grants access to all secured services using the same policy.<\/p>\n<p class=\"\" data-start=\"663\" data-end=\"959\">That\u2019s why I wanted to create a custom policy \u2014 to add fine-grained access control to individual services. At first, things looked promising. Oracle provides a good example of a custom policy that limits access based on IP address \u2014 you can apply it to a specific proxy and define allowed IPs, and can be easily attached to a SOAP\/WSDL proxy service.<\/p>\n<p class=\"\" data-start=\"961\" data-end=\"1055\">However, when I tried attaching this policy to a REST or ANY\/XML proxy, I ran into this error:<\/p>\n<p data-pm-slice=\"1 3 []\"><strong>[OSB-398128] <\/strong>One of the Web service policy attached is not allowed on service TEST\/TestProxy because the service binding does not support it.<\/p>\n<p class=\"\" data-start=\"186\" data-end=\"535\">For that reason, I opened a Service Request (SR) with Oracle, explaining that OWSM custom policies don\u2019t work on REST and ANY\/XML proxies. Oracle Support was responsive and helpful \u2014 and they did find an answer.\u00a0 Unfortunately, it wasn\u2019t the one I was hoping for: They pointed to an outstanding enhancement request. Their response confirmed that attaching custom policies to REST or ANY_XML proxies isn\u2019t supported.<\/p>\n<p class=\"\" data-start=\"537\" data-end=\"608\">Luckily, I kept working on the JIRA ticket while the SR was open.<\/p>\n<blockquote><p><strong>Spoiler alert: I got it working!<\/strong><\/p><\/blockquote>\n<p class=\"\" data-start=\"230\" data-end=\"419\">In this blog post, I\u2019ll walk you through how I got it to work \u2014 step by step \u2014 and how you can implement your own custom policies and attach them to REST and ANY\/XML services in OSB.<\/p>\n<p class=\"\" data-start=\"421\" data-end=\"561\">Oh, and this isn\u2019t just about JWT.\u00a0 This workaround will likely work for <em data-start=\"495\" data-end=\"500\">any<\/em> custom policy you want to attach to a REST or ANY\/XML proxy.<\/p>\n<h2>Disclaimer<\/h2>\n<p class=\"\" data-start=\"316\" data-end=\"568\">This solution was tested and validated on Oracle Service Bus 12c (12.2.1.4). At the time of writing, I haven\u2019t tested it on 14c yet \u2014 that work is in progress. I\u2019ll update this post (or write a follow-up) once I\u2019ve confirmed compatibility with 14c. The example code has been cleaned and modified to avoid exposing proprietary details.<\/p>\n<p class=\"\" data-start=\"570\" data-end=\"779\">It serves as a proof of concept, not a production-ready implementation \u2014 you\u2019ll need to adapt it to your own environment.<\/p>\n<p class=\"\" data-start=\"636\" data-end=\"743\"><strong data-start=\"636\" data-end=\"650\">Important:<\/strong> This approach is <strong>NOT<\/strong> officially supported by Oracle. Use it at your own risk and discretion.<\/p>\n<h2>I got lucky?<\/h2>\n<p>Honestly, if I have seen the enhancement request beforehand, I probably wouldn\u2019t even have picked up the ticket. But I didn\u2019t know. I was just being stubborn, curious, and \u2014 let\u2019s be honest \u2014 a bit lucky. Sometimes not knowing something is &#8220;impossible&#8221; is the best way to get it done.<\/p>\n<p>The key to making this work was something surprisingly simple:<\/p>\n<p>You can&#8217;t export internal Oracle policies directly. But you <em>can<\/em> clone them. And once you&#8217;ve cloned an internal policy, you&#8217;re free to download it, see its contents and modify it. By adding a reference to your own custom Java class and giving the policy a new name, it suddenly becomes attachable to REST services \u2014 and it works.<\/p>\n<p>My proof of concept was based on just that:<\/p>\n<ol start=\"1\" data-spread=\"false\">\n<li>I exported a standard internal policy as-is. ( <strong>oracle\/http_jwt_token_service_policy<\/strong> )<\/li>\n<li>I modified a few properties<\/li>\n<li>I added a single element to trigger my Java class.<\/li>\n<li>That was it. That small change made the difference. And it executed as expected.<\/li>\n<\/ol>\n<h2>Step 1. Export cloned policy<\/h2>\n<p class=\"\" data-start=\"202\" data-end=\"306\">First, open <code data-start=\"214\" data-end=\"238\">&lt;yourhost:yourport\/em&gt;<\/code> and navigate to Weblogic Domain -&gt; Web Services -&gt; WSM Policies<\/p>\n<p data-start=\"202\" data-end=\"306\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-188 size-full\" src=\"https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/OWSM_1_Policies_screen.png\" alt=\"\" width=\"1044\" height=\"431\" srcset=\"https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/OWSM_1_Policies_screen.png 1044w, https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/OWSM_1_Policies_screen-300x124.png 300w, https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/OWSM_1_Policies_screen-1024x423.png 1024w, https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/OWSM_1_Policies_screen-768x317.png 768w, https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/OWSM_1_Policies_screen-850x351.png 850w\" sizes=\"auto, (max-width: 1044px) 100vw, 1044px\" \/><\/p>\n<p class=\"\" data-start=\"308\" data-end=\"399\">Select the <code data-start=\"319\" data-end=\"357\">oracle\/http_jwt_token_service_policy<\/code> and click <strong data-start=\"368\" data-end=\"383\">Create Like<\/strong> in the top bar.<\/p>\n<p data-start=\"308\" data-end=\"399\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-189 size-full\" src=\"https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/OWSM_2_CreateLike.png\" alt=\"\" width=\"994\" height=\"484\" srcset=\"https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/OWSM_2_CreateLike.png 994w, https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/OWSM_2_CreateLike-300x146.png 300w, https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/OWSM_2_CreateLike-768x374.png 768w, https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/OWSM_2_CreateLike-850x414.png 850w\" sizes=\"auto, (max-width: 994px) 100vw, 994px\" \/><\/p>\n<p data-start=\"308\" data-end=\"399\">Give your copy a meaningful name \u2014 adjust the name, display name, and description as needed.<\/p>\n<p class=\"\" data-start=\"401\" data-end=\"521\">Next, locate the copy you just created, click <strong data-start=\"447\" data-end=\"457\">Export<\/strong>, and save the resulting ZIP file somewhere on your local drive.<\/p>\n<h2>Step 2. Modify the policy XML<\/h2>\n<p class=\"\" data-start=\"192\" data-end=\"363\">Locate the ZIP file and extract its contents. Inside, you\u2019ll find a <code data-start=\"260\" data-end=\"270\">META-INF<\/code> directory, and within that, a <code data-start=\"301\" data-end=\"311\">policies<\/code> directory. That\u2019s where your exported policy lives.<\/p>\n<p class=\"\" data-start=\"365\" data-end=\"566\">Start by renaming <code data-start=\"383\" data-end=\"395\">policy.xml<\/code> to something more meaningful \u2014 for example: <code data-start=\"440\" data-end=\"467\">proofofconcept_policy.xml<\/code>, or whatever fits your naming convention.<br data-start=\"509\" data-end=\"512\" \/>Then open the file in a text editor such as Notepad++.<\/p>\n<p class=\"\" data-start=\"568\" data-end=\"677\">Next, remove both &#8220;Logging&#8221; sections \u2014 they serve no purpose in your custom policy and can be safely deleted.<\/p>\n<p class=\"\" data-start=\"679\" data-end=\"740\">There are several parts in the file that need to be modified:<\/p>\n<p class=\"\" data-start=\"575\" data-end=\"619\"><strong data-start=\"575\" data-end=\"619\">1. Update the <code data-start=\"591\" data-end=\"605\">&lt;wsp:Policy&gt;<\/code> attributes:<\/strong><\/p>\n<ul data-start=\"621\" data-end=\"699\">\n<li class=\"\" data-start=\"621\" data-end=\"645\">\n<p class=\"\" data-start=\"623\" data-end=\"645\"><code data-start=\"623\" data-end=\"643\">orawsp:description<\/code><\/p>\n<\/li>\n<li class=\"\" data-start=\"646\" data-end=\"663\">\n<p class=\"\" data-start=\"648\" data-end=\"663\"><code data-start=\"648\" data-end=\"661\">orawsp:Name<\/code><\/p>\n<\/li>\n<li class=\"\" data-start=\"664\" data-end=\"688\">\n<p class=\"\" data-start=\"666\" data-end=\"688\"><code data-start=\"666\" data-end=\"686\">orawsp:displayName<\/code><\/p>\n<\/li>\n<li class=\"\" data-start=\"689\" data-end=\"699\">\n<p class=\"\" data-start=\"691\" data-end=\"699\"><code data-start=\"691\" data-end=\"699\">wsu:Id<\/code><\/p>\n<\/li>\n<\/ul>\n<p class=\"\" data-start=\"701\" data-end=\"777\">Make sure these values are unique to avoid conflicts with existing policies.<\/p>\n<p class=\"\" data-start=\"784\" data-end=\"838\"><strong data-start=\"784\" data-end=\"838\">2. Update the <code data-start=\"800\" data-end=\"827\">&lt;orasp:http-jwt-security&gt;<\/code> section:<\/strong><\/p>\n<ul data-start=\"840\" data-end=\"1015\">\n<li class=\"\" data-start=\"840\" data-end=\"967\">\n<p class=\"\" data-start=\"842\" data-end=\"967\"><code data-start=\"842\" data-end=\"856\">ns0:category<\/code> \u2192 use <code data-start=\"863\" data-end=\"887\">security\/authorization<\/code><br data-start=\"887\" data-end=\"890\" \/><em data-start=\"892\" data-end=\"965\">(Important: You can\u2019t attach two identical policies to the same proxy.)<\/em><\/p>\n<\/li>\n<li class=\"\" data-start=\"968\" data-end=\"1015\">\n<p class=\"\" data-start=\"970\" data-end=\"1015\"><code data-start=\"970\" data-end=\"980\">ns0:name<\/code> \u2192 give your policy a distinct name<\/p>\n<\/li>\n<\/ul>\n<p class=\"\" data-start=\"1022\" data-end=\"1060\"><strong data-start=\"1022\" data-end=\"1060\">3. Link to your custom Java class:<\/strong><\/p>\n<p class=\"\" data-start=\"1062\" data-end=\"1104\">Inside the <code data-start=\"1073\" data-end=\"1092\">&lt;orawsp:bindings&gt;<\/code> block, add:<\/p>\n<pre class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary\"> &lt;orawsp:Implementation&gt;nl.test.owsmpolicy.jwt.SomeCustomExecutor&lt;\/orawsp:Implementation&gt;<\/pre>\n<p>Now save your changed file. Make sure that the XML file is valid!<\/p>\n<p class=\"\" data-start=\"1302\" data-end=\"1343\"><strong data-start=\"1302\" data-end=\"1343\">4. Check the <code data-start=\"1317\" data-end=\"1334\">orawsp:provides<\/code> block:<\/strong><\/p>\n<p class=\"\" data-start=\"1345\" data-end=\"1390\">Make sure it includes the following bindings:<\/p>\n<pre> orawsp:provides=\" {http:\/\/docs.oasis-open.org\/ns\/opencsa\/sca\/200912}authentication, \r\n{http:\/\/docs.oasis-open.org\/ns\/opencsa\/sca\/200912}clientAuthentication, \r\n{http:\/\/docs.oasis-open.org\/ns\/opencsa\/sca\/200912}clientAuthentication.transport, \r\n{http:\/\/schemas.oracle.com\/ws\/2006\/01\/policy}SOAP_HTTP, \r\n{http:\/\/schemas.oracle.com\/ws\/2006\/01\/policy}REST_HTTP, \r\n{http:\/\/schemas.oracle.com\/ws\/2006\/01\/policy}URL, \r\n{http:\/\/schemas.oracle.com\/ws\/2006\/01\/policy}token.http.jwt\"<\/pre>\n<p>Explanation:<\/p>\n<ul>\n<li>SOAP_HTTP: binding for WSDL\/SOAP<\/li>\n<li>REST_HTTP: binding for REST<\/li>\n<li>URL: binding for ANY\/XML<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-190 size-full\" src=\"https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/geany.png\" alt=\"\" width=\"1277\" height=\"796\" srcset=\"https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/geany.png 1277w, https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/geany-300x187.png 300w, https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/geany-1024x638.png 1024w, https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/geany-768x479.png 768w, https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/geany-850x530.png 850w\" sizes=\"auto, (max-width: 1277px) 100vw, 1277px\" \/><\/p>\n<p class=\"\" data-start=\"2030\" data-end=\"2054\"><strong data-start=\"2030\" data-end=\"2054\">5. Save and validate<\/strong><\/p>\n<p class=\"\" data-start=\"2056\" data-end=\"2200\">Once you\u2019ve made your changes, save the file and make sure the XML is valid. A simple typo or missing namespace can break the policy deployment.<\/p>\n<h3>Summary<\/h3>\n<p class=\"\" data-start=\"279\" data-end=\"511\">My guess is that the <code data-start=\"300\" data-end=\"326\">&lt;orasp:jwt-token-policy&gt;<\/code> element is the key to all of this. It behaves differently than a <code data-start=\"392\" data-end=\"418\">&lt;orasp:genericAssertion&gt;<\/code>. You can\u2019t attach a <code data-start=\"439\" data-end=\"457\">genericAssertion<\/code> to a REST or ANY\/XML proxy \u2014 it\u2019s simply not allowed.<\/p>\n<p class=\"\" data-start=\"513\" data-end=\"750\">However, the combination of <code data-start=\"541\" data-end=\"559\">jwt-token-policy<\/code> and a reference to custom Java code <em data-start=\"596\" data-end=\"602\">does<\/em> work. And that\u2019s the key: because the Java class takes precedence over the internal\/default behavior, it effectively overrides Oracle\u2019s limitation.<\/p>\n<p data-start=\"513\" data-end=\"750\">This subtle difference is what makes the workaround possible.<\/p>\n<h2>Step 3. Import the custom policy<\/h2>\n<p class=\"\" data-start=\"270\" data-end=\"372\">Before you can import your newly created policy, you need to package it into a specific ZIP structure.<\/p>\n<p class=\"\" data-start=\"374\" data-end=\"397\">The required format is:<\/p>\n<ul>\n<li>META_INF\n<ul>\n<li>policies\n<ul>\n<li>proofofconcept_policy.xml<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p class=\"\" data-start=\"466\" data-end=\"571\">Create this simple folder structure and place your modified <code data-start=\"526\" data-end=\"538\">policy.xml<\/code> inside the <code data-start=\"550\" data-end=\"560\">policies<\/code> directory.<\/p>\n<p class=\"\" data-start=\"573\" data-end=\"682\">Then open <code data-start=\"583\" data-end=\"607\">&lt;yourhost:yourport\/em&gt;<\/code> again and navigate to: <strong data-start=\"633\" data-end=\"682\">WebLogic Domain \u2192 Web Services \u2192 WSM Policies<\/strong><\/p>\n<p class=\"\" data-start=\"684\" data-end=\"748\">Click <strong data-start=\"690\" data-end=\"700\">Import<\/strong>, select your ZIP file, and complete the import.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-191 size-full\" src=\"https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/OWSM_3_import_modified.png\" alt=\"\" width=\"430\" height=\"213\" srcset=\"https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/OWSM_3_import_modified.png 430w, https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/OWSM_3_import_modified-300x149.png 300w\" sizes=\"auto, (max-width: 430px) 100vw, 430px\" \/><\/p>\n<p>After importing, you\u2019ll see a confirmation message indicating that the policy was successfully imported.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-192 size-full\" src=\"https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/OWSM_4_imported.png\" alt=\"\" width=\"681\" height=\"147\" srcset=\"https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/OWSM_4_imported.png 681w, https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/OWSM_4_imported-300x65.png 300w\" sizes=\"auto, (max-width: 681px) 100vw, 681px\" \/><\/p>\n<p>Once the import is complete, scroll down the list of policies. Your newly imported policy should be listed near the bottom, using the name you provided earlier.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-193 size-full\" src=\"https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/OWSM_5_imported_success.png\" alt=\"\" width=\"800\" height=\"32\" srcset=\"https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/OWSM_5_imported_success.png 800w, https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/OWSM_5_imported_success-300x12.png 300w, https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/OWSM_5_imported_success-768x31.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/p>\n<p>This is what the newly imported policy looks like. The green checkmark confirms that it\u2019s active and ready to be attached.<\/p>\n<h2>Step 4. Attach the policy<\/h2>\n<p class=\"\" data-start=\"194\" data-end=\"305\">Now it\u2019s time to attach the policy to a REST proxy service.<br data-start=\"253\" data-end=\"256\" \/>In this example, I\u2019ll be using the <strong data-start=\"291\" data-end=\"304\">sbconsole<\/strong>.<\/p>\n<p class=\"\" data-start=\"307\" data-end=\"392\">Open <code data-start=\"312\" data-end=\"343\">&lt;yourhost:yourport\/sbconsole&gt;<\/code> and locate the proxy service you want to modify.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-194 size-full\" src=\"https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/OSB_1_TEST_REST.png\" alt=\"\" width=\"583\" height=\"380\" srcset=\"https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/OSB_1_TEST_REST.png 583w, https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/OSB_1_TEST_REST-300x196.png 300w\" sizes=\"auto, (max-width: 583px) 100vw, 583px\" \/><\/p>\n<p class=\"\" data-start=\"193\" data-end=\"286\">Create a new session and navigate to the <strong data-start=\"234\" data-end=\"244\">Policy<\/strong> tab inside your Proxy Service definition.<\/p>\n<p class=\"\" data-start=\"288\" data-end=\"448\">Click <strong data-start=\"294\" data-end=\"308\">Add Policy<\/strong> \u2014 a popup will open.<br data-start=\"329\" data-end=\"332\" \/>Navigate to the last page of the list, where you\u2019ll find your newly imported policy. Select it and click <strong data-start=\"437\" data-end=\"447\">Attach<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-195 size-full\" src=\"https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/OSB_2_Attached_policy.png\" alt=\"\" width=\"684\" height=\"181\" srcset=\"https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/OSB_2_Attached_policy.png 684w, https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/OSB_2_Attached_policy-300x79.png 300w\" sizes=\"auto, (max-width: 684px) 100vw, 684px\" \/><\/p>\n<p>Press <strong data-start=\"176\" data-end=\"182\">OK<\/strong> to confirm the policy attachment.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-196 size-full\" src=\"https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/OSB_3_Success_No_error.png\" alt=\"\" width=\"1241\" height=\"422\" srcset=\"https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/OSB_3_Success_No_error.png 1241w, https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/OSB_3_Success_No_error-300x102.png 300w, https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/OSB_3_Success_No_error-1024x348.png 1024w, https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/OSB_3_Success_No_error-768x261.png 768w, https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/OSB_3_Success_No_error-850x289.png 850w\" sizes=\"auto, (max-width: 1241px) 100vw, 1241px\" \/><\/p>\n<p class=\"\" data-start=\"186\" data-end=\"282\">You can now see that the policy has been added. Click the <strong data-start=\"244\" data-end=\"252\">Save<\/strong> icon to persist your changes.<\/p>\n<p class=\"\" data-start=\"284\" data-end=\"399\">Normally, at this point, you would get the known error I mentioned earlier \u2014 <strong data-start=\"364\" data-end=\"399\">but this time, it won\u2019t appear.<\/strong><\/p>\n<p class=\"\" data-start=\"401\" data-end=\"434\">That\u2019s it \u2014 the OSB part is done.<\/p>\n<h2>Java implementation<\/h2>\n<p class=\"\" data-start=\"200\" data-end=\"356\">Now create a simple Java project. Oracle\u2019s <strong data-start=\"245\" data-end=\"260\">IPAssertion<\/strong> example provides a good starting point \u2014 just make sure your class extends <code data-start=\"336\" data-end=\"355\">AssertionExecutor<\/code>. The only JAR that is needed as a dependency is: com.oracle.webservices.fmw.client.jar. This file can be found somewhere in your weblogic installation directory.<\/p>\n<p class=\"\" data-start=\"358\" data-end=\"461\">For this proof of concept, I created a minimal Java project. A screenshot of the code is shown below:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-198 size-full\" src=\"https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/javacode.png\" alt=\"\" width=\"1320\" height=\"1189\" srcset=\"https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/javacode.png 1320w, https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/javacode-300x270.png 300w, https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/javacode-1024x922.png 1024w, https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/javacode-768x692.png 768w, https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/javacode-850x766.png 850w\" sizes=\"auto, (max-width: 1320px) 100vw, 1320px\" \/><\/p>\n<p class=\"\" data-start=\"217\" data-end=\"373\">The code is executed in three possible stages: <strong data-start=\"264\" data-end=\"275\">request<\/strong>, <strong data-start=\"277\" data-end=\"289\">response<\/strong>, and <strong data-start=\"295\" data-end=\"304\">error<\/strong>. In our case, we only want to run it during the <strong data-start=\"355\" data-end=\"366\">request<\/strong> stage.<\/p>\n<p class=\"\" data-start=\"375\" data-end=\"410\">This code does a few simple things:<\/p>\n<ul data-start=\"412\" data-end=\"628\">\n<li class=\"\" data-start=\"412\" data-end=\"573\">\n<p class=\"\" data-start=\"414\" data-end=\"573\">It fetches all policy properties.<br data-start=\"447\" data-end=\"450\" \/><em data-start=\"452\" data-end=\"571\">(Note: <code data-start=\"460\" data-end=\"476\">debug.location<\/code> isn\u2019t shown in the screenshot, but the static method defaults it to <code data-start=\"545\" data-end=\"568\">\/var\/opt\/log\/weblogic<\/code>.)<\/em><\/p>\n<\/li>\n<li class=\"\" data-start=\"574\" data-end=\"628\">\n<p class=\"\" data-start=\"576\" data-end=\"628\">It writes the line <code data-start=\"595\" data-end=\"613\">\"This is a test\"<\/code> to a log file.<\/p>\n<\/li>\n<\/ul>\n<p class=\"\" data-start=\"630\" data-end=\"821\">Now simply create a plain JAR file \u2014 name it something like <code data-start=\"690\" data-end=\"703\">TestPoc.jar<\/code> \u2014 and copy it to your <code data-start=\"726\" data-end=\"742\">osb_domain\/lib<\/code> directory.<\/p>\n<p class=\"\" data-start=\"630\" data-end=\"821\">For good measure, restart your OSB domain after placing the file.<\/p>\n<p class=\"\" data-start=\"167\" data-end=\"296\">Now simply call your REST endpoint and check the log file \u2014 either in <code data-start=\"237\" data-end=\"260\">\/var\/opt\/log\/weblogic<\/code> or in the directory you configured.<\/p>\n<p class=\"\" data-start=\"298\" data-end=\"347\">If everything went well, you should see the line:<\/p>\n<blockquote data-start=\"349\" data-end=\"367\">\n<p class=\"\" data-start=\"351\" data-end=\"367\"><code data-start=\"351\" data-end=\"367\">This is a test<\/code><\/p>\n<\/blockquote>\n<p class=\"\" data-start=\"369\" data-end=\"453\">That\u2019s your proof: the custom policy was triggered, and your Java code was executed. See screenshot below:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-199 size-full\" src=\"https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/screenshot_testpoc.png\" alt=\"\" width=\"1552\" height=\"759\" srcset=\"https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/screenshot_testpoc.png 1552w, https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/screenshot_testpoc-300x147.png 300w, https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/screenshot_testpoc-1024x501.png 1024w, https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/screenshot_testpoc-768x376.png 768w, https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/screenshot_testpoc-1536x751.png 1536w, https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/screenshot_testpoc-850x416.png 850w\" sizes=\"auto, (max-width: 1552px) 100vw, 1552px\" \/><\/p>\n<p><strong data-start=\"203\" data-end=\"216\">It works!<\/strong><br data-start=\"216\" data-end=\"219\" \/>The custom policy is attached to a REST proxy, the Java code is executed, and the proof is in the log.<\/p>\n<h2>Minor glitch<\/h2>\n<p class=\"\" data-start=\"304\" data-end=\"347\">There is one minor glitch in this approach.<\/p>\n<p class=\"\" data-start=\"349\" data-end=\"638\">The <code data-start=\"353\" data-end=\"362\">IResult<\/code> object has a <code data-start=\"376\" data-end=\"395\">setWSMException()<\/code> method, and the <code data-start=\"412\" data-end=\"426\">WSMException<\/code> class provides several constructors to choose from. In theory, setting a <code data-start=\"502\" data-end=\"516\">WSMException<\/code> should allow you to influence the HTTP response code returned by the proxy. Without it, the policy result will be either:<\/p>\n<ul data-start=\"639\" data-end=\"693\">\n<li class=\"\" data-start=\"639\" data-end=\"658\">\n<p class=\"\" data-start=\"641\" data-end=\"658\">HTTP 200 (OK), or<\/p>\n<\/li>\n<li class=\"\" data-start=\"639\" data-end=\"658\">\n<p class=\"\" data-start=\"641\" data-end=\"658\">HTTP 500 (Internal Server Error)<\/p>\n<\/li>\n<\/ul>\n<p class=\"\" data-start=\"695\" data-end=\"810\">I suspect that when a <code data-start=\"717\" data-end=\"731\">WSMException<\/code> is properly set, a more appropriate HTTP 401 (Unauthorized) could be returned. However \u2014 and here\u2019s the problem \u2014 no matter which constructor I try, the instantiation of the <code data-start=\"907\" data-end=\"921\">WSMException<\/code> always fails.<br data-start=\"935\" data-end=\"938\" \/>Not the line that sets it, but the line that creates it.<\/p>\n<p class=\"\" data-start=\"252\" data-end=\"450\">The most likely explanation is that the loophole used here \u2014 cloning and reusing an internal policy structure \u2014 isn\u2019t designed to handle a <code data-start=\"391\" data-end=\"405\">WSMException<\/code> being returned from a custom implementation.<\/p>\n<p class=\"\" data-start=\"452\" data-end=\"572\">Another possibility is that it has to do with the specific binding type of the proxy service (REST vs. SOAP or ANY_XML).<\/p>\n<p class=\"\" data-start=\"574\" data-end=\"623\">For now, I\u2019m not entirely sure what\u2019s causing it.<\/p>\n<p data-start=\"574\" data-end=\"623\">If you find the solution, please let me know \u2014 I\u2019d love to update this workaround with a cleaner way to return proper HTTP status codes.<\/p>\n<h2>Summary<\/h2>\n<p class=\"\" data-start=\"255\" data-end=\"432\">Even though Oracle WSM does not officially support attaching custom policies to REST or ANY\/XML proxies, there is a fully working workaround using an existing policy structure.<\/p>\n<p class=\"\" data-start=\"434\" data-end=\"567\">My guess is that the custom Java class is picked up earlier \u2014 and executed before the default internal logic of that policy kicks in.<\/p>\n<p data-start=\"434\" data-end=\"567\">I hope this code helps you get custom policies working in your own project. It took me quite some time to figure this out \u2014 hopefully, this article will help you save that time.<\/p>\n<p data-start=\"434\" data-end=\"567\">And again, I can\u2019t stress this enough:<br data-start=\"598\" data-end=\"601\" \/><strong data-start=\"603\" data-end=\"617\">Important:<\/strong> this approach is <em data-start=\"635\" data-end=\"640\">not<\/em> officially supported by Oracle. Use it at your own risk and discretion.<\/p>\n<p data-start=\"434\" data-end=\"567\">If it helped you, feel free to share it \u2014 or drop me a note.<\/p>\n<h2 data-start=\"434\" data-end=\"567\">Files<\/h2>\n<p><a href=\"https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/owsm_poc.zip\">owsm_poc<\/a><\/p>\n<p data-start=\"434\" data-end=\"567\">Brain out!<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to attach custom OWSM policies to REST (Oracle OSB)<\/p>\n","protected":false},"author":1,"featured_media":208,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[114,118,119,120,123,116,20,122,16,121,17,18,32,117,113],"class_list":["post-179","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-coding","tag-any","tag-assertion","tag-custom","tag-custom-assertion","tag-integration","tag-java","tag-jwt","tag-middleware","tag-oracle","tag-oracle-service-bus","tag-osb","tag-owsm","tag-policy","tag-proxy","tag-rest"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Oracle WSM, JWT and custom policies - Brain&#039;s Ramblings<\/title>\n<meta name=\"description\" content=\"A working workaround for attaching custom policies to REST and ANY_XML proxies in Oracle OSB \u2014 step-by-step.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.familie-kleinman.nl\/brain\/index.php\/2025\/04\/17\/oracle-wsm-jwt-and-custom-policies\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Oracle WSM, JWT and custom policies - Brain&#039;s Ramblings\" \/>\n<meta property=\"og:description\" content=\"A working workaround for attaching custom policies to REST and ANY_XML proxies in Oracle OSB \u2014 step-by-step.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.familie-kleinman.nl\/brain\/index.php\/2025\/04\/17\/oracle-wsm-jwt-and-custom-policies\/\" \/>\n<meta property=\"og:site_name\" content=\"Brain&#039;s Ramblings\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-17T19:01:16+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-17T20:01:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/custom_rest.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"1024\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Brain\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Brain\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.familie-kleinman.nl\\\/brain\\\/index.php\\\/2025\\\/04\\\/17\\\/oracle-wsm-jwt-and-custom-policies\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.familie-kleinman.nl\\\/brain\\\/index.php\\\/2025\\\/04\\\/17\\\/oracle-wsm-jwt-and-custom-policies\\\/\"},\"author\":{\"name\":\"Brain\",\"@id\":\"https:\\\/\\\/www.familie-kleinman.nl\\\/brain\\\/#\\\/schema\\\/person\\\/24700e1628cfd605409636397a9bb6ab\"},\"headline\":\"Oracle WSM, JWT and custom policies\",\"datePublished\":\"2025-04-17T19:01:16+00:00\",\"dateModified\":\"2025-04-17T20:01:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.familie-kleinman.nl\\\/brain\\\/index.php\\\/2025\\\/04\\\/17\\\/oracle-wsm-jwt-and-custom-policies\\\/\"},\"wordCount\":1773,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.familie-kleinman.nl\\\/brain\\\/#\\\/schema\\\/person\\\/24700e1628cfd605409636397a9bb6ab\"},\"image\":{\"@id\":\"https:\\\/\\\/www.familie-kleinman.nl\\\/brain\\\/index.php\\\/2025\\\/04\\\/17\\\/oracle-wsm-jwt-and-custom-policies\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.familie-kleinman.nl\\\/brain\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/custom_rest.png\",\"keywords\":[\"any\",\"assertion\",\"custom\",\"Custom Assertion\",\"integration\",\"Java\",\"JWT\",\"Middleware\",\"Oracle\",\"Oracle Service Bus\",\"OSB\",\"OWSM\",\"Policy\",\"Proxy\",\"REST\"],\"articleSection\":[\"Coding\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.familie-kleinman.nl\\\/brain\\\/index.php\\\/2025\\\/04\\\/17\\\/oracle-wsm-jwt-and-custom-policies\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.familie-kleinman.nl\\\/brain\\\/index.php\\\/2025\\\/04\\\/17\\\/oracle-wsm-jwt-and-custom-policies\\\/\",\"url\":\"https:\\\/\\\/www.familie-kleinman.nl\\\/brain\\\/index.php\\\/2025\\\/04\\\/17\\\/oracle-wsm-jwt-and-custom-policies\\\/\",\"name\":\"Oracle WSM, JWT and custom policies - Brain&#039;s Ramblings\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.familie-kleinman.nl\\\/brain\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.familie-kleinman.nl\\\/brain\\\/index.php\\\/2025\\\/04\\\/17\\\/oracle-wsm-jwt-and-custom-policies\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.familie-kleinman.nl\\\/brain\\\/index.php\\\/2025\\\/04\\\/17\\\/oracle-wsm-jwt-and-custom-policies\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.familie-kleinman.nl\\\/brain\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/custom_rest.png\",\"datePublished\":\"2025-04-17T19:01:16+00:00\",\"dateModified\":\"2025-04-17T20:01:17+00:00\",\"description\":\"A working workaround for attaching custom policies to REST and ANY_XML proxies in Oracle OSB \u2014 step-by-step.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.familie-kleinman.nl\\\/brain\\\/index.php\\\/2025\\\/04\\\/17\\\/oracle-wsm-jwt-and-custom-policies\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.familie-kleinman.nl\\\/brain\\\/index.php\\\/2025\\\/04\\\/17\\\/oracle-wsm-jwt-and-custom-policies\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.familie-kleinman.nl\\\/brain\\\/index.php\\\/2025\\\/04\\\/17\\\/oracle-wsm-jwt-and-custom-policies\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.familie-kleinman.nl\\\/brain\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/custom_rest.png\",\"contentUrl\":\"https:\\\/\\\/www.familie-kleinman.nl\\\/brain\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/custom_rest.png\",\"width\":1024,\"height\":1024},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.familie-kleinman.nl\\\/brain\\\/index.php\\\/2025\\\/04\\\/17\\\/oracle-wsm-jwt-and-custom-policies\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.familie-kleinman.nl\\\/brain\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Oracle WSM, JWT and custom policies\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.familie-kleinman.nl\\\/brain\\\/#website\",\"url\":\"https:\\\/\\\/www.familie-kleinman.nl\\\/brain\\\/\",\"name\":\"Brain's Ramblings\",\"description\":\"Code, commitment, caffeine, and the odd mindfart\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.familie-kleinman.nl\\\/brain\\\/#\\\/schema\\\/person\\\/24700e1628cfd605409636397a9bb6ab\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.familie-kleinman.nl\\\/brain\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.familie-kleinman.nl\\\/brain\\\/#\\\/schema\\\/person\\\/24700e1628cfd605409636397a9bb6ab\",\"name\":\"Brain\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.familie-kleinman.nl\\\/brain\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/brain_brain.png\",\"url\":\"https:\\\/\\\/www.familie-kleinman.nl\\\/brain\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/brain_brain.png\",\"contentUrl\":\"https:\\\/\\\/www.familie-kleinman.nl\\\/brain\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/brain_brain.png\",\"width\":1024,\"height\":1024,\"caption\":\"Brain\"},\"logo\":{\"@id\":\"https:\\\/\\\/www.familie-kleinman.nl\\\/brain\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/brain_brain.png\"},\"sameAs\":[\"https:\\\/\\\/www.familie-kleinman.nl\\\/brain\"],\"url\":\"https:\\\/\\\/www.familie-kleinman.nl\\\/brain\\\/index.php\\\/author\\\/brain\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Oracle WSM, JWT and custom policies - Brain&#039;s Ramblings","description":"A working workaround for attaching custom policies to REST and ANY_XML proxies in Oracle OSB \u2014 step-by-step.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.familie-kleinman.nl\/brain\/index.php\/2025\/04\/17\/oracle-wsm-jwt-and-custom-policies\/","og_locale":"en_US","og_type":"article","og_title":"Oracle WSM, JWT and custom policies - Brain&#039;s Ramblings","og_description":"A working workaround for attaching custom policies to REST and ANY_XML proxies in Oracle OSB \u2014 step-by-step.","og_url":"https:\/\/www.familie-kleinman.nl\/brain\/index.php\/2025\/04\/17\/oracle-wsm-jwt-and-custom-policies\/","og_site_name":"Brain&#039;s Ramblings","article_published_time":"2025-04-17T19:01:16+00:00","article_modified_time":"2025-04-17T20:01:17+00:00","og_image":[{"width":1024,"height":1024,"url":"https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/custom_rest.png","type":"image\/png"}],"author":"Brain","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Brain","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.familie-kleinman.nl\/brain\/index.php\/2025\/04\/17\/oracle-wsm-jwt-and-custom-policies\/#article","isPartOf":{"@id":"https:\/\/www.familie-kleinman.nl\/brain\/index.php\/2025\/04\/17\/oracle-wsm-jwt-and-custom-policies\/"},"author":{"name":"Brain","@id":"https:\/\/www.familie-kleinman.nl\/brain\/#\/schema\/person\/24700e1628cfd605409636397a9bb6ab"},"headline":"Oracle WSM, JWT and custom policies","datePublished":"2025-04-17T19:01:16+00:00","dateModified":"2025-04-17T20:01:17+00:00","mainEntityOfPage":{"@id":"https:\/\/www.familie-kleinman.nl\/brain\/index.php\/2025\/04\/17\/oracle-wsm-jwt-and-custom-policies\/"},"wordCount":1773,"commentCount":0,"publisher":{"@id":"https:\/\/www.familie-kleinman.nl\/brain\/#\/schema\/person\/24700e1628cfd605409636397a9bb6ab"},"image":{"@id":"https:\/\/www.familie-kleinman.nl\/brain\/index.php\/2025\/04\/17\/oracle-wsm-jwt-and-custom-policies\/#primaryimage"},"thumbnailUrl":"https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/custom_rest.png","keywords":["any","assertion","custom","Custom Assertion","integration","Java","JWT","Middleware","Oracle","Oracle Service Bus","OSB","OWSM","Policy","Proxy","REST"],"articleSection":["Coding"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.familie-kleinman.nl\/brain\/index.php\/2025\/04\/17\/oracle-wsm-jwt-and-custom-policies\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.familie-kleinman.nl\/brain\/index.php\/2025\/04\/17\/oracle-wsm-jwt-and-custom-policies\/","url":"https:\/\/www.familie-kleinman.nl\/brain\/index.php\/2025\/04\/17\/oracle-wsm-jwt-and-custom-policies\/","name":"Oracle WSM, JWT and custom policies - Brain&#039;s Ramblings","isPartOf":{"@id":"https:\/\/www.familie-kleinman.nl\/brain\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.familie-kleinman.nl\/brain\/index.php\/2025\/04\/17\/oracle-wsm-jwt-and-custom-policies\/#primaryimage"},"image":{"@id":"https:\/\/www.familie-kleinman.nl\/brain\/index.php\/2025\/04\/17\/oracle-wsm-jwt-and-custom-policies\/#primaryimage"},"thumbnailUrl":"https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/custom_rest.png","datePublished":"2025-04-17T19:01:16+00:00","dateModified":"2025-04-17T20:01:17+00:00","description":"A working workaround for attaching custom policies to REST and ANY_XML proxies in Oracle OSB \u2014 step-by-step.","breadcrumb":{"@id":"https:\/\/www.familie-kleinman.nl\/brain\/index.php\/2025\/04\/17\/oracle-wsm-jwt-and-custom-policies\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.familie-kleinman.nl\/brain\/index.php\/2025\/04\/17\/oracle-wsm-jwt-and-custom-policies\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.familie-kleinman.nl\/brain\/index.php\/2025\/04\/17\/oracle-wsm-jwt-and-custom-policies\/#primaryimage","url":"https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/custom_rest.png","contentUrl":"https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/custom_rest.png","width":1024,"height":1024},{"@type":"BreadcrumbList","@id":"https:\/\/www.familie-kleinman.nl\/brain\/index.php\/2025\/04\/17\/oracle-wsm-jwt-and-custom-policies\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.familie-kleinman.nl\/brain\/"},{"@type":"ListItem","position":2,"name":"Oracle WSM, JWT and custom policies"}]},{"@type":"WebSite","@id":"https:\/\/www.familie-kleinman.nl\/brain\/#website","url":"https:\/\/www.familie-kleinman.nl\/brain\/","name":"Brain's Ramblings","description":"Code, commitment, caffeine, and the odd mindfart","publisher":{"@id":"https:\/\/www.familie-kleinman.nl\/brain\/#\/schema\/person\/24700e1628cfd605409636397a9bb6ab"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.familie-kleinman.nl\/brain\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.familie-kleinman.nl\/brain\/#\/schema\/person\/24700e1628cfd605409636397a9bb6ab","name":"Brain","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/brain_brain.png","url":"https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/brain_brain.png","contentUrl":"https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/brain_brain.png","width":1024,"height":1024,"caption":"Brain"},"logo":{"@id":"https:\/\/www.familie-kleinman.nl\/brain\/wp-content\/uploads\/2025\/04\/brain_brain.png"},"sameAs":["https:\/\/www.familie-kleinman.nl\/brain"],"url":"https:\/\/www.familie-kleinman.nl\/brain\/index.php\/author\/brain\/"}]}},"_links":{"self":[{"href":"https:\/\/www.familie-kleinman.nl\/brain\/index.php\/wp-json\/wp\/v2\/posts\/179","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.familie-kleinman.nl\/brain\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.familie-kleinman.nl\/brain\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.familie-kleinman.nl\/brain\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.familie-kleinman.nl\/brain\/index.php\/wp-json\/wp\/v2\/comments?post=179"}],"version-history":[{"count":21,"href":"https:\/\/www.familie-kleinman.nl\/brain\/index.php\/wp-json\/wp\/v2\/posts\/179\/revisions"}],"predecessor-version":[{"id":213,"href":"https:\/\/www.familie-kleinman.nl\/brain\/index.php\/wp-json\/wp\/v2\/posts\/179\/revisions\/213"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.familie-kleinman.nl\/brain\/index.php\/wp-json\/wp\/v2\/media\/208"}],"wp:attachment":[{"href":"https:\/\/www.familie-kleinman.nl\/brain\/index.php\/wp-json\/wp\/v2\/media?parent=179"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.familie-kleinman.nl\/brain\/index.php\/wp-json\/wp\/v2\/categories?post=179"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.familie-kleinman.nl\/brain\/index.php\/wp-json\/wp\/v2\/tags?post=179"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}