Hello gRPC community,

I am in the process of a major overhaul to a C++ project using gRPC 
extensively. Much of the work concerns going from sync to async services. 
Another important part is new authentication and tokens.

Up until now, all my messages, by contract, contained a field acting as a 
auth token for the user. Let's call it token:
 

> message MyRequest {
> pdm.PbAuthToken token   = 1;      // always given in
> ... actual parameters
> }


There are template functions that add this token to all calls and others to 
read it back out, in order to verify authentication. Now I'm in the process 
of migrating to a different kind of token and verification and I came 
across a base class called CallCredentials, which appears to serve that 
very purpose but wrapped up in gRPC. Keen to explore this I came across 
this https://grpc.io/docs/guides/auth.html but that isn't very verbose on 
how this would be done.

Basically, I want to attach my own token to every call (ideally, I would 
have some calls accepted without it as well) and not having to extract and 
verify it explicitly in every handler. And it must work in async server 
impls in order to be useful for me. Does anybody have bit of an example of 
this? Does it make sense to explore this or should I just stick to my 
existing mechanism?
 
Best regards...
Stephan


-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To post to this group, send email to grpc-io@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/83fead92-7574-48c1-b25d-4a8cce66b72d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to