-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
However yandex cloud docs about getting IAM from JWT token says that KID (key id) field is required to be provided in JWT, IamJwtCredentialsProviderdoesn't require it and creates incorrect JWT token. That behavior leads to such exceptions (see stacktrace below):
Grpc.Core.RpcException: Status(StatusCode="Unauthenticated", Detail="The required field 'kid' is missing from the JWT header")
at Grpc.Net.Client.Internal.HttpClientCallInvoker.BlockingUnaryCall[TRequest,TResponse](Method`2 method, String host, CallOptions options, TRequest request)
at Grpc.Core.Interceptors.InterceptingCallInvoker.<BlockingUnaryCall>b__3_0[TRequest,TResponse](TRequest req, ClientInterceptorContext`2 ctx)
at Grpc.Core.ClientBase.ClientBaseConfiguration.ClientBaseConfigurationInterceptor.BlockingUnaryCall[TRequest,TResponse](TRequest request, ClientInterceptorContext`2 context, BlockingUnaryCallContinuation`2 continuation)
at Grpc.Core.Interceptors.InterceptingCallInvoker.BlockingUnaryCall[TRequest,TResponse](Method`2 method, String host, CallOptions options, TRequest request)
at Yandex.Cloud.Iam.V1.IamTokenService.IamTokenServiceClient.Create(CreateIamTokenRequest request, CallOptions options)
at Yandex.Cloud.Iam.V1.IamTokenService.IamTokenServiceClient.Create(CreateIamTokenRequest request, Metadata headers, Nullable`1 deadline, CancellationToken cancellationToken)
at Yandex.Cloud.Credentials.IamJwtCredentialsProvider.GetToken()
The solution is to get KID from ctor parameters and create headers with KID value in it.
Related:
PR with authorized keys credentials provider: #27
Issue with request for authorized keys credentials provider: #29
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels