You can generate a UUID in code, but that will only be valid for the length of deployment. This could be passed in as an option to your client. The best way to identify clients and do it securely is using mTLS (which gRPC does support).
On Wed, Aug 12, 2020 at 6:28 AM Sachin Bharadwaj S < [email protected]> wrote: > > I am implementing gRPC server application and multiple clients are > connected to my server and starts to call RPCs. > > > How can the server uniquely identify which client is calling the RPC? > > > Let us assume that server exposes a register RPC and client is implemented > in such a way that it calls the register API only once and at the start of > the client. > > > Let us also assume that the server guarantees to generate and assign a > unique ID for each client in the register RPC. > > > For example, > > Client A -> ID=1 > > Client B -> ID=2 > > > Is there a way to get back the ID associated with the client when an RPC > is called? > > > We do not want to send the ID to the client and ask the client to send the > same ID in all the further RPCs which leads to change in the .proto file. > > How can this be handled in gRPC? > > > Can I keep this sticky ID somewhere in the context and get back in all the > RPC associated with the same client? > > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/grpc-io/d77ee459-64c8-4730-836d-670878d63948o%40googlegroups.com > <https://groups.google.com/d/msgid/grpc-io/d77ee459-64c8-4730-836d-670878d63948o%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Mya Pitzeruse Principal Software Engineer - Service Infrastructure Gender Pronouns: She, Her, Hers [email protected] Indeed - We help people get jobs. Indeed.com <http://www.indeed.com/> Facebook <http://www.facebook.com/indeed> | Twitter <http://www.twitter.com/indeed> | Instagram <http://www.instagram.com/indeedworks> -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/CAHa8AVROwfxycc3KOFsXaCc_bggtpfdEru6f%2B0Uo2wK5FudEzQ%40mail.gmail.com.
