Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Token-based authentication #39

Open
gsahancsc opened this issue Dec 6, 2022 · 0 comments
Open

Token-based authentication #39

gsahancsc opened this issue Dec 6, 2022 · 0 comments

Comments

@gsahancsc
Copy link

Hi,
trying to replace grpc with grpc_kit to call regular grpc endpoint, I can call using grpc but after changing grpc_kit it has 'EOFError (EOF):' error. I thought that remote server closed connection because of applying credentials.

I coundn't find GRPC::Core::ChannelCredentials or related in grpc_kit, could you please advice ?

old code grpc , it works ;

creds = GRPC::Core::ChannelCredentials.new(nil, nil, nil)
stub = Com::VService::Speech::V1::Speech::Stub.new(SERVER, creds)
metadata = { authorization: "Bearer TokenX" , trackingid: '123'}
stub.get_recognize(req, metadata: metadata)

new with grpc_kit ( if I don't stringify_keys it raises cannot convert symbol to string error )

sock = TCPSocket.new('host.co', 443)
stub = Com::VService::Speech::V1::Speech::Stub.new(sock)
metadata = { authorization: "Bearer TokenX", trackingid: '123'}
stub.get_recognize(req, metadata: metadata.stringify_keys)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant