Oracle SOA - 使用 x-form-urlencoded 调用服务
Oracle SOA - Invoking a service with x-form-urlencoded
需要你的帮助!
目标:
调用一个 API 将生成一个正文类型为 x-form-urlencoded 的令牌。
结果:
400-错误请求
到目前为止我们所做的是 ff:
- 在调用 属性 中指出 Content-Type : apppication/x-form-urlencoded.
- 分配 grant_type 的值并在变量中断言,如下所示。
grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer&assertion=eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiAiM01WRzlMekt4YTQzenFkSWR4TGJaRVlQOUFnMzNOS0FGcVJ6aDdRM21hTWRJSjAwVmxMakI4bE5oaFRMN0M1Tm1OT0M4eUN6c1F1RUdEbVlVcTVzVyIsICJzdWIiOiAisdasdbi5sb3JlbnpvQGhvZWdoLmNvbS5zb2FhdXRoIiwgImF1ZCI6ICJodHRwczovL3Rlc3Quc2FsZXNmb3JjZS5jb20iLCAiZXhwIjogIjE2Mjk5NDQwMDcifQ.JiAEVW0sP96If24-oYTiCVMK8oyDlo_xfT4Yei44AYAwH0trfRtJCDZOsuDdOLkdAz0kRValqrPcOuPzPIfyWtrSAHU0bUWwmAc9XK5pV4MLgfKuZ_AfkLSygdu0Z9Tk9eG4WYyj953STNY316vTXQwa_uWG
- 在痕迹中。 & 转换为 '&' 不确定这是否是这里的问题。我们确定断言密钥是有效的 尝试通过 postman/soapui 调用 api.
<messages><input> <urlEncoded><urlEncoded xmlns:def="http://www.w3.org/2001/XMLSchema" xsi:type="def:string" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer&amp;assertion=eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiAiM01WRzlMekt4YTQzenFkSWR4TGJaRVlQOUFnMzNOS0FGcVJ6aDdRM21hTWRJSjAwVmxMakI4bE5oaFRMN0M1Tm1OT0M4eUN6c1F1RUdEbVlVcTVzVyIsICJzdWIiOiAiam9obi5sb3JlbnpvQGhvZWdoLmNvbS5zb2FhdXRoIiwgImF1ZCI6ICJodHRwczovL3Rlc3Quc2FsZXNmb3JjZS5jb20iLCAiZXhwIjogIjE2Mjk5NDQwMDcifQ.JiAEVW0sP96If24-oYTiCVMK8oyDlo_adadsAwH0trfRtJCDZOsuDdOLkdAz0kRValqrPcOuPzPIfyWtrSAHU0bUWwmAc9XK5pV4MLgfKuZ_AfkLSygdu0Z9Tk9eG4WYyj953STNY316vTXQwa_uWGAb2bsfVWWX1Jvdjwc3oSGtKfZl4IaVVAvIYnVWVrTgrY80M0LQhDBp5UKkTzI-Mam_NaRN30GFlwrJipwFPgm8t-eJ__FU-srpLO4LZG5FBseUOLVtnmrDlxPm7l_i8ee8vKTzNvgySLt0hVC4C1e51xFY4OSkNMa6E3jF-YnEkJJERMW82fFozalg</urlEncoded></urlEncoded></input><fault> <bpelFault><faultType>0</faultType><bindingFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="summary"><summary>Bad Request</summary></part><part name="code"><code>400</code></part><part name="detail"><detail>{"error":"unsupported_grant_type","error_description":"grant type not supported"}</detail></part></bindingFault></bpelFault></fault><faultType> <message>0</message></faultType></messages>
- 此外,我们还尝试使用 oracle 的 toCdata 将授权类型和断言包装在 cdata 中,但没有成功!!!啊!
<messages><input> <urlEncoded><urlEncoded xmlns:def="http://www.w3.org/2001/XMLSchema" xsi:type="def:string" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><![CDATA[grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer&assertion=eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiAiM01WRzlMekt4YTQzenFkSWR4TGJaRVlQOUFnMzNOS0FGcVJ6aDdRM21hTWRJSjAwVmxMakI4bE5oaFRMN0M1Tm1OT0M4eUN6c1F1RUdEbVlVcTVzVyIsICJzdWIiOiAiam9obi5sb3JlbnpvQGhvZWdoLmNvbS5zb2FhdXRoIiwgImF1ZCI6ICJodHRwczovL3Rlc3Quc2FsZXNmb3JjZS5jb20iLCAiZXhwIjogIjE2Mjk5NDUwMzkifQ.oi4LFRjX_iF-9tRCzvlLO-JJLg4xMDMnLSHXCz627LqYaC0UqYe2gsUEPZJ8Wpa-5SyosWJLkAp7T98Bpy-JqHni5jL4Ef50zsJ8gXloThhdB3LIMsQ3nZ4tpoP_4tYoa8Tc90oma3hlbZ_9GnGh19oy3eLsxr0odZA5cEFWwyxs20vb4XJ0za0RxeO3-bcH2M9k904mzTPZVM4x7MqJW--EHYhaLwYJj__HHsLvpFI6iP0vcc1FcTbjbDZsvBsMS_F5L6RYbOiua2rTV4FHdqi085-x_qms2yEMxhGdYSZFEIMzaoe9TMYpWIMZ34Dfjj84t0bCIXWL5ZVfdH3tcQ]]></urlEncoded></urlEncoded></input><fault> <bpelFault><faultType>0</faultType><bindingFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="summary"><summary>Bad Request</summary></part><part name="code"><code>400</code></part><part name="detail"><detail>{"error":"unsupported_grant_type","error_description":"grant type not supported"}</detail></part></bindingFault></bpelFault></fault><faultType> <message>0</message></faultType></messages>
任何suggestions/recommendation?
解决方案:
- 在参考泳道中,确保在请求负载中 url 编码是 selected。
添加 grant_type,并将断言作为查询参数。
- 在 bpel 中,调用 > 属性 选项卡,select rest.query.grant_type 值为
urn:ietf:params:oauth:grant-type:jwt-bearer 。在断言中执行相同的过程。
需要你的帮助!
目标: 调用一个 API 将生成一个正文类型为 x-form-urlencoded 的令牌。
结果: 400-错误请求
到目前为止我们所做的是 ff:
- 在调用 属性 中指出 Content-Type : apppication/x-form-urlencoded.
- 分配 grant_type 的值并在变量中断言,如下所示。
grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer&assertion=eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiAiM01WRzlMekt4YTQzenFkSWR4TGJaRVlQOUFnMzNOS0FGcVJ6aDdRM21hTWRJSjAwVmxMakI4bE5oaFRMN0M1Tm1OT0M4eUN6c1F1RUdEbVlVcTVzVyIsICJzdWIiOiAisdasdbi5sb3JlbnpvQGhvZWdoLmNvbS5zb2FhdXRoIiwgImF1ZCI6ICJodHRwczovL3Rlc3Quc2FsZXNmb3JjZS5jb20iLCAiZXhwIjogIjE2Mjk5NDQwMDcifQ.JiAEVW0sP96If24-oYTiCVMK8oyDlo_xfT4Yei44AYAwH0trfRtJCDZOsuDdOLkdAz0kRValqrPcOuPzPIfyWtrSAHU0bUWwmAc9XK5pV4MLgfKuZ_AfkLSygdu0Z9Tk9eG4WYyj953STNY316vTXQwa_uWG
- 在痕迹中。 & 转换为 '&' 不确定这是否是这里的问题。我们确定断言密钥是有效的 尝试通过 postman/soapui 调用 api.
<messages><input> <urlEncoded><urlEncoded xmlns:def="http://www.w3.org/2001/XMLSchema" xsi:type="def:string" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer&amp;assertion=eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiAiM01WRzlMekt4YTQzenFkSWR4TGJaRVlQOUFnMzNOS0FGcVJ6aDdRM21hTWRJSjAwVmxMakI4bE5oaFRMN0M1Tm1OT0M4eUN6c1F1RUdEbVlVcTVzVyIsICJzdWIiOiAiam9obi5sb3JlbnpvQGhvZWdoLmNvbS5zb2FhdXRoIiwgImF1ZCI6ICJodHRwczovL3Rlc3Quc2FsZXNmb3JjZS5jb20iLCAiZXhwIjogIjE2Mjk5NDQwMDcifQ.JiAEVW0sP96If24-oYTiCVMK8oyDlo_adadsAwH0trfRtJCDZOsuDdOLkdAz0kRValqrPcOuPzPIfyWtrSAHU0bUWwmAc9XK5pV4MLgfKuZ_AfkLSygdu0Z9Tk9eG4WYyj953STNY316vTXQwa_uWGAb2bsfVWWX1Jvdjwc3oSGtKfZl4IaVVAvIYnVWVrTgrY80M0LQhDBp5UKkTzI-Mam_NaRN30GFlwrJipwFPgm8t-eJ__FU-srpLO4LZG5FBseUOLVtnmrDlxPm7l_i8ee8vKTzNvgySLt0hVC4C1e51xFY4OSkNMa6E3jF-YnEkJJERMW82fFozalg</urlEncoded></urlEncoded></input><fault> <bpelFault><faultType>0</faultType><bindingFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="summary"><summary>Bad Request</summary></part><part name="code"><code>400</code></part><part name="detail"><detail>{"error":"unsupported_grant_type","error_description":"grant type not supported"}</detail></part></bindingFault></bpelFault></fault><faultType> <message>0</message></faultType></messages>
- 此外,我们还尝试使用 oracle 的 toCdata 将授权类型和断言包装在 cdata 中,但没有成功!!!啊!
<messages><input> <urlEncoded><urlEncoded xmlns:def="http://www.w3.org/2001/XMLSchema" xsi:type="def:string" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><![CDATA[grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer&assertion=eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiAiM01WRzlMekt4YTQzenFkSWR4TGJaRVlQOUFnMzNOS0FGcVJ6aDdRM21hTWRJSjAwVmxMakI4bE5oaFRMN0M1Tm1OT0M4eUN6c1F1RUdEbVlVcTVzVyIsICJzdWIiOiAiam9obi5sb3JlbnpvQGhvZWdoLmNvbS5zb2FhdXRoIiwgImF1ZCI6ICJodHRwczovL3Rlc3Quc2FsZXNmb3JjZS5jb20iLCAiZXhwIjogIjE2Mjk5NDUwMzkifQ.oi4LFRjX_iF-9tRCzvlLO-JJLg4xMDMnLSHXCz627LqYaC0UqYe2gsUEPZJ8Wpa-5SyosWJLkAp7T98Bpy-JqHni5jL4Ef50zsJ8gXloThhdB3LIMsQ3nZ4tpoP_4tYoa8Tc90oma3hlbZ_9GnGh19oy3eLsxr0odZA5cEFWwyxs20vb4XJ0za0RxeO3-bcH2M9k904mzTPZVM4x7MqJW--EHYhaLwYJj__HHsLvpFI6iP0vcc1FcTbjbDZsvBsMS_F5L6RYbOiua2rTV4FHdqi085-x_qms2yEMxhGdYSZFEIMzaoe9TMYpWIMZ34Dfjj84t0bCIXWL5ZVfdH3tcQ]]></urlEncoded></urlEncoded></input><fault> <bpelFault><faultType>0</faultType><bindingFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="summary"><summary>Bad Request</summary></part><part name="code"><code>400</code></part><part name="detail"><detail>{"error":"unsupported_grant_type","error_description":"grant type not supported"}</detail></part></bindingFault></bpelFault></fault><faultType> <message>0</message></faultType></messages>
任何suggestions/recommendation?
解决方案:
- 在参考泳道中,确保在请求负载中 url 编码是 selected。 添加 grant_type,并将断言作为查询参数。
- 在 bpel 中,调用 > 属性 选项卡,select rest.query.grant_type 值为 urn:ietf:params:oauth:grant-type:jwt-bearer 。在断言中执行相同的过程。