Akka-grpc documentation provides a basic example of adding authentication through Akka-http.
At the end, it suggests that the authentication result can be embedded in the metadata
of the HttpRequest
and can be accessible in the grpc service methods as the metadata argument, with proper configuration enabling the powerAPI
, in the conf
file.
Also, on the details page, it says that metadata is for providing access to request headers in the grpc service interfaces; which makes sense. It also provides an example of how a Metadata
instance can be built with MetadataBuilder
.
Now, the question is this:
How can I pass the constructed metadata object with information on the authenticated user to the HttpRequest? Am I supposed to use the addHeader
method or another one?