Repository navigation
plugging in authentication... #30
Replies: 1 comment
|
Hi @raul-guerrero, happy you are here and you've asked very good questions. You can use token-based authentication (e.g. JWTs) by extracting and validating them from gRPC metadata. These are basically HTTP/2 headers so there's a quite a bit of flexibility on how you could use this (docs here). e.g. auto data = ctx.meta("authorization");
// TODO: validateTo avoid duplicating code, you probably would want to use a "middleware" approach. I've done something similar for error handling in a different project here. There's no support for SSL/TLS and ALTS authentication or compression yet, but if there's more interest I'm happy to add those features (you are welcome to contribute with a PR as well). Although, you could use a proxy/gateway (like Envoy) to add SSL/TLS and compression if really needed and most likely this is a better approach since you probably will need a proxy/gateway to load balance traffic. P.S I'm moving this to a discussion so we can continue the conversation. |
Uh oh!
There was an error while loading. Please reload this page.
Hi,
The official gRPC API has pluggable authentication as well as compression, is there a way I can achieve that with grpcxx?
I'm sorry if it's a simple question, I'm a newbie to gRPC and I bumped into your articles and found your gRPC approach very interesting.
All reactions