I've generated my client code from proto files. Now I'm trying to connect but get the 'jwt' is not located at the context
error from server. Here's what I do:
$myServiceClient = new MyServiceClient(
"$host:$port",
[
'credentials' => ChannelCredentials::createInsecure(),
'update_metadata' => function ($metaData) use ($token) {
// $metaData['authorization'] = ['jwt' . $token]; // doesn't work
// $metaData['authorization']['jwt'] = $token; // doesn't work
// $metaData['jwt'] = $token; // doesn't work
$metaData['authorization'] = ['Bearer ' . $token]; // doesn't work
return $metaData;
},
]
);
$unaryCall = $myServiceClient->MyMethod(new MyMethodRequest());
$wait = $unaryCall->wait();