TimOrtel/GRPC-Kotlin-Multiplatform

How do we get io.grpc.CallCredential working in the commonMain module ?

oianmol opened this issue · 1 comments

I want to apply metadata to the requests like JWT token etc.., can you help me where to look for regarding this ?

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).