This seems to be for grpc c++ only. Similar class like MetadataCredentialsFromPlugin or CompositeChannelCredentials do not exist in GRPC Java.
On Wednesday, February 7, 2018 at 12:20:11 PM UTC-8, [email protected] wrote: > > I'm looking into how to support client connections to disparate services > using custom oAuth2 tokens. The services may or may not support SSL/TLS. > > I have created a custom authenticator plugin following the sample code at > https://grpc.io/docs/guides/auth.html. > > I build my custom call credentials and store them using a > CompositeChannelCredientials object > > auto call_creds = > grpc::MetadataCredentialsFromPlugin(std::unique_ptr<grpc::MetadataCredentialsPlugin>(new > > MyCustomAuthenticator(accessToken))); > > if (secure) > mCredentials = > grpc::CompositeChannelCredentials(grpc::SslCredentials(opts), call_creds); > else > mCredentials = > grpc::CompositeChannelCredentials(grpc::InsecureChannelCredentials(), > call_creds); > > However, I noticed during debugging that mCredentials is nullptr when > connecting to a service that doesn't support SSL/TLS. It looks like > CompositeChannelCredentials attempts to cast the InsecureChannelCredentials > to SecureChannelCredentials, with this cast returning NULL. > > Is there any documentation or sample code of how to make an authenticated > call over an insecure channel? Is this something that's currently supported > in the C++ API? > -- CONFIDENTIALITY NOTICE NOTICE: This message is intended for the use of the individual or entity to which it is addressed and may contain information that is confidential, privileged and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, you are hereby notified that any printing, copying, dissemination, distribution, disclosure or forwarding of this communication is strictly prohibited. If you have received this communication in error, please contact the sender immediately and delete it from your system. Thank You. -- 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 post to this group, send email to [email protected]. 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/25fc2496-de93-4e19-996c-e0bd8abbaffd%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
