Skip to content

Token-based authentication #39

Open
@gsahancsc

Description

@gsahancsc

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions