サービスファブリックのステートレスサービスでは、クレームベースの認可がサポートされていますか?要求/ JWTをサービスファブリックのステートレスサービスに渡すにはどうすればよいですか?
ヘッダーにJWTを受け取るWeb APIがあるとします。 JWTまたはクレームをサービスファブリックのステートレスサービスに渡して、機密性の高い操作を実行する前にクレームをチェックすることはできますか?私たちはClaimsCredentialsを使用して、サービスへの特許請求の範囲に渡すことができていることがわかります
:
var serviceProxyFactory = new ServiceProxyFactory(
(callbackClient) => new FabricTransportServiceRemotingClientFactory(
new FabricTransportSettings
{
SecurityCredentials = new ClaimsCredentials
{
LocalClaims = "[JWT HERE? or just Claims JSON?]"
}
}));
IMyService service = serviceProxyFactory.CreateServiceProxy<IMyService>(new Uri("fabric:/MyThing/MyService"));
https://msdn.microsoft.com/en-us/library/azure/system.fabric.claimscredentials.localclaims.aspxはLocalClaimsがあると言う「クレームの文字列表現は、STS(セキュリティトークンサービス)から取得したトークンです。」また
:値のプロパティ:
が実際にClaimsCredentials JWT base64エンコード、または請求項キーのちょうどJSONペイロードですか?
ステートレスサービスで実行する必要のある特定の設定やコードはありますか?
ステートレスサービスからクレームへのアクセス方法を教えてください。
System.Fabric.FabricCannotConnectException: Error in Connection during ServiceCommunication ---> System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x80071C4C\r\n at Microsoft.ServiceFabric.Services.Communication.FabricTransport.Common.NativeServiceCommunication.IFabricServiceCommunicationClient2.EndRequest(IFabricAsyncOperationContext context)\r\n at Microsoft.ServiceFabric.Services.Communication.FabricTransport.Client.NativeServiceCommunicationClient.EndRequest(IFabricAsyncOperationContext context)\r\n at System.Fabric.Interop.AsyncCallOutAdapter2`1.Finish(IFabricAsyncOperationContext context, Boolean expectedCompletedSynchronously)\r\n --- End of inner exception stack trace ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.ServiceFabric.Services.Communication.FabricTransport.Client.NativeServiceCommunicationClient.<RequestResponseAsync>d__8.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.ServiceFabric.Services.Communication.Client.ServicePartitionClient`1.<InvokeWithRetryAsync>d__7`1.MoveNext()
ありがとう:
現時点で
は、私がサービスを呼び出すときに、私は次のエラーを取得する、どんな値IはにLocalClaimsを設定していません!