Combines two call credentials into a single credential that applies both.
The resulting credential will apply both sets of credentials in order, allowing multiple authentication mechanisms to be used simultaneously. For example, combining channel credentials with call credentials, or applying multiple authentication headers to the same call.
The combined credential requires transport security if either of the original credentials requires it.
Example
val tlsCreds = TlsClientCredentials { ... }
val bearerToken = BearerTokenCredentials("my-token")
val combined = tlsCreds + bearerTokenMultiple credentials can be chained:
val combined = creds1 + creds2 + creds3Return
A new credential that applies both credentials.
Parameters
The credential to combine with this one.
See also
Combines client credentials with call credentials.
This operator allows attaching per-call authentication credentials to a client credential, enabling both transport security (via GrpcClientCredentials) and application-layer authentication (via GrpcCallCredentials) to be used together for all requests of the client.
Example
val tlsCredentials = GrpcTlsClientCredentials {
trustManager(serverCertPem)
}
val bearerToken = BearerTokenCredentials("my-token")
val combined = tlsCredentials + bearerToken
val client = GrpcClient("example.com", 443) {
credentials = combined
}Return
A new credential that includes both client and call credentials.
Parameters
The call credentials to combine with this client credential.