簡體   English   中英

wso2 API Manager“不支持的客戶端身份驗證方法!”

[英]wso2 API Manager “Unsupported Client Authentication Method!”

我試圖使用的OAuth2 grant_type =密碼令牌請求作為描述這里與WSO2 API管理器。 使用以下curl命令。

curl -k -d "grant_type=password&username=<uname>&password=<pwd>&scope=PRODUCTION" http://localhost:8280/token

該請求的響應為:

{"error":"invalid_request","error_description":"Missing parameters: client_id"}

接下來,提供我的使用者密鑰,並且curl請求變為以下內容:

curl -k -d "grant_type=password&username=<uname>&password=<pwd>&scope=PRODUCTION&client_id=<myconsumerkey>" http://localhost:8280/token

但是,響應令人困惑:

{"error":"unsupported_client_authentication_method","error_description":"Unsupported Client Authentication Method!"}

所以,我的問題是API Man是否不支持該grant_type? 還是我在這里做錯了什么? 我應該在身份服務器上查看這種授予類型嗎?

干杯

您要在HTTP基本授權標頭中發送客戶端憑據(客戶端密鑰和機密)。 卷曲命令將如下所示。 在這里,“-user client-Key:client-Secret”已用於使用curl命令創建基本授權標頭。 您可以將以下命令與值一起使用。

curl --user tFVhXORF35S9TTyeaZIH2IEXEw4a:4h6fq4jgRYKrr4v91A_zQgw4Xtoa -k -d“ grant_type = password&username = admin&password = admin” -H“內容類型:application / x-www-form-urlencoded”:https:// { /令牌

除此之外,我猜WSO2API不支持在請求正文中接收客戶端憑據。 根據OAuth 2.0規范,不建議使用。 在這里檢查

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM