0

Webブラウザ経由でApiに正常に呼び出すことができます。 IdentityModelを使用すると問題なく動作します。 しかし、私がFiddler経由でApiを呼び出そうとすると、私はinvalid_clientを取得します。私のクライアント情報は、MembershipReboot Clientテーブルに基づくデータベースから得られます。Fiddler IdentityServer3経由でアクセストークンを取得できません

私はポストボディと認証ベースでデータを渡そうとしました。どちらも失敗します。

フィドラーの実際のエンコードされた値が表示さ

User-Agent: Fiddler 
Host: qaquasaridentity 
Content-Length: 0 
Content-Type: application/x-www-form-urlencoded 
Authorization: Basic dGVzdC5hcGk6c2VjcmV0 

>私は、次のしている認証基本符号化されたパラメータを使用して呼び出す:

No Proxy-Authorization Header is present. 

Authorization Header is present: Basic dGVzdC5hcGk6c2VjcmV0 
Decoded Username:Password= test.api:secret 

私はデータが渡されたパラメータのためのポストのボディを使用して呼び出します次のとおりです。

client_id=test.api 
&client_secret=secret 
&grant_type=client_credentials 
&scope=testapi 

サーバーログには

2017-01-20 12:06:13.968 -06:00 [Debug] Start client validation 
2017-01-20 12:06:13.971 -06:00 [Debug] Start parsing Basic Authentication secret 
2017-01-20 12:06:13.973 -06:00 [Debug] Start parsing for secret in post body 
2017-01-20 12:06:13.973 -06:00 [Debug] No secret in post body found 
2017-01-20 12:06:13.976 -06:00 [Debug] Start parsing for X.509 certificate 
2017-01-20 12:06:13.976 -06:00 [Debug] client_id is not found in post body 
w3wp.exe Information: 0 : 2017-01-20 12:06:13.976 -06:00 [Information] Parser found no secret 
w3wp.exe Information: 0 : 2017-01-20 12:06:13.981 -06:00 [Information] No client secret found 
w3wp.exe Information: 0 : 2017-01-20 12:06:13.983 -06:00 [Information] End token request 
w3wp.exe Information: 0 : 2017-01-20 12:06:13.988 -06:00 [Information] Returning error: invalid_client 

enter image description here 私はのclient_idとclient_secretを持っていますが、エラー・ログには、それ以外の場合は言います。 誰も私が間違っていることを説明することはできますか?バックエンドで.NET経由でaccess_tokenを取得できますが、Fiddlerではアクセスできません。

答えて

0

enter image description hereトークンエンドポイントはJSONではなくフォームデータを使用します。

POST /connect/token 

grant_type=client_credentials&client_id=test.api&client_secret=secret&scope=api 

http://openid.net/specs/openid-connect-core-1_0.html#TokenRequest https://identityserver.github.io/Documentation/docsv2/endpoints/token.html

+0

私は同じエラーが同様のことをやってもらいます。しかし、エラーログに無効なハッシングアルゴリズムが表示されるようになりました。あなたの例のように私はPostBody経由で情報を提供しています。 – Keith

+0

"Basic"とbase64でエンコードされたclientid:clientsecretの間に余分な空白があるように見えます。それはそれかもしれませんか? –

+0

認証は基本的ではありませんか?あなたの例のようにPostBodyを使用すると、認証Basic XXXXXは必要ありません。正しい? – Keith

関連する問題