タグ付けされた質問 「ocelot」

1
リクエストヘッダーがIdentityServer4に転送されない
認証にIdentityServer4を使用するマイクロサービスのAPIゲートウェイとしてocelotを使用しています。ocelot設定ファイルに「AuthenticationOptions」を追加して、apiキーを設定しました。ではスタートアップ Iは、Identityサーバーを追加します。IDサーバーでは、ヘッダーの値を使用して、接続文字列を動的に構築します。トークンを取得するリクエストを送信すると、IDサービスでヘッダーにアクセスできます。しかし、トークンを使用して次のリクエストを送信すると、元のヘッダーが使用できません。IDサービスで表示できるのは「Host」ヘッダーのみです。 リクエストをアイデンティティサーバーにルーティングする間、元のヘッダーを保持する方法はありますか? Startup.cs(IDサーバーの追加) services .AddAuthentication() .AddIdentityServerAuthentication("APIParts", options => { options.Authority = "http://localhost:60168"; options.RequireHttpsMetadata = false; options.ApiName = "Parts"; options.SupportedTokens = SupportedTokens.Both; }); ocelot.json ReRoutes": [ { "DownstreamPathTemplate": "/connect/token", "DownstreamScheme": "http", "DownstreamHostAndPorts": [ { "Host": "localhost", "Port": 60168 } ], "UpstreamPathTemplate": "/token", "UpstreamHttpMethod": [ "Post" ] }, { "DownstreamPathTemplate": "/api/Parts/Inventory", …
弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.