How do we get io.grpc.CallCredential working in the commonMain module ?
oianmol opened this issue · 1 comments
oianmol commented
I want to apply metadata to the requests like JWT token etc.., can you help me where to look for regarding this ?
TimOrtel commented
The generated service stubs come with an optional function parameter called metadata
.
The way I use it:
KMMetadata().apply {
if (token != null) {
set(AUTHENTICATION_TOKEN_KEY, token)
}
}
Of course, it would be nice to be able to supply this metadata in KMStub with a function withMetadata(metadata)
.