需要你的帮助!
目标:调用一个 API,该 API 将生成一个主体类型为 x-form-urlencoded 的令牌。
结果:400-错误请求
到目前为止,我们所做的是 ff:
- 在调用属性 (to) 中指明 Content-Type :apppication/x-form-urlencoded。
- 在如下变量中分配 grant_type 和 assertion 的值。
grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer&assertion=eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiAiM01WRzlMekt4YTQzenFkSWR4TGJaRVlQOUFnMzNOS0FGcVJ6aDdRM21hTWRJSjAwVmxMakI4bE5oaFRMN0M1Tm1OT0M4eUN6c1F1RUdEbVlVcTVzVyIsICJzdWIiOiAisdasdbi5sb3JlbnpvQGhvZWdoLmNvbS5zb2FhdXRoIiwgImF1ZCI6ICJodHRwczovL3Rlc3Quc2FsZXNmb3JjZS5jb20iLCAiZXhwIjogIjE2Mjk5NDQwMDcifQ.JiAEVW0sP96If24-oYTiCVMK8oyDlo_xfT4Yei44AYAwH0trfRtJCDZOsuDdOLkdAz0kRValqrPcOuPzPIfyWtrSAHU0bUWwmAc9XK5pV4MLgfKuZ_AfkLSygdu0Z9Tk9eG4WYyj953STNY316vTXQwa_uWG
- 在踪迹中。& 转换为 '&' 不确定这是否是这里的问题。我们确定断言密钥是有效的,邮递员/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>
Anyyyy建议/推荐?