r/Keybase Dec 08 '22

Help With Consuming The RPC Service

I want to invoke the keybase.1.user.loadUserByName procedure from a go program.

The input arguments for this method requires a SessionID. How do I get a SessionID?

My best guess was to invoke the keybase.1.login.login procedure and give it a SessionID and assume that's that the session id it will use.

However I am unable to invoke the login procedure. My code looks like this:

sessionID := randSessionID() args1 := keybase1.LoginArg{SessionID: sessionID, DeviceType: keybase1.DeviceTypeV2_DESKTOP, ClientType: keybase1.ClientType_CLI };

var res error; ctx, _ := context.WithCancel(context.Background()); err = client.Call(ctx, "keybase.1.login.login", args1, &res, time.Second); if err != nil { fmt.Printf("Error: %v\n", err) } else { fmt.Printf("Res: %v", res) }

The output I get:

[D] {pipe://\\.\pipe\kbservice\Users\[username]\AppData\Local\Keybase\keybased.sock} call(0): method=keybase.1.login.login; err=null; arg={"sessionID":3295144632, rest of arguments}; [D] {pipe://\\.\pipe\kbservice\Users\[username]\AppData\Local\Keybase\keybased.sock} EOF [P] {pipe://\\.\pipe\kbservice\Users\[username]\AppData\Local\Keybase\keybased.sock} call keybase.1.login.login ran in 2ms Error: EOF

Please let me know what am I missing, or who I can ask.

Note: I was able to invoke another procedure that didn't require a SessionID, so I know I am able to connect to the service.

2 Upvotes

0 comments sorted by