Yaak Logo
Yaak
Feedback/gRPC basic auth encoding

gRPC basic auth encoding

iGoStats ·2 years ago
Released

Doing the gRPC request using basic auth, I’m setting the username and password, and the server responds with basic auth token is not valid base64: illegal base64 data - indicating that the credentials are not encoded.

Copy pasting the same request and credentials to Postman work, it does encode the basic auth header I guess.

I’ve tried encoding the password alone, etc. But as far as I know, the whole credentials must be encode, for example, here https://www.rfc-editor.org/rfc/rfc2617#section-2

Could you please let me know if I can configure it somehow in Yaak or is this something has to be adjusted on the app side?

Thanks!


Comments (9)

Sign in to leave a comment.

Gregory Schier

What version are you running? There was a fix related to this recently

iGoStats OP

Updated today to 9.0, was about to install the new beta-10

Gregory Schier

Hmm, 2024.9.0 should be working. I just tested with httpbin and am getting success. Are you able to print the Authorization header in your server and see if something looks off?

I also checked with Curl and am getting the same header sent as Yaak.

curl -v -X GET 'httpbin.org/basic-auth/user/passs' \
  --user 'user:pass'

iGoStats OP

So, had some time to fiddle a bit today. Wanted to remind you that this is gRPC request, perhaps there are differences in the implementation, not sure?

Anywho, I’m firing up the request with these credentials

On the server side I get this header:

Basic dGVzdC1hY2NvdW50OkpRQlNSd3hkUkZ0ZnRLWg

And trying to base64 decode it I’m getting

└─╼ echo "dGVzdC1hY2NvdW50OkpRQlNSd3hkUkZ0ZnRLWg" | base64 -d    
test-account:JQBSRwxdRFtftKZbase64: invalid input

I’ve played around with similar examples, including my real credentials. It doesn’t seem very stable, sometimes adding “1” at the end of the username, or deleting some characters off the password produce a properly encoded string.


I hope you can pinpoint the issue! Let me know if you need more details. Thanks!

iGoStats OP

Oh, here’s what I’ve noticed - if I do the request with postman, I get an additional “=” in the end of the encoded string, that must be it, the line termination

Gregory Schier

Ooo yes, gRPC. The fix was only applied to http so I'll make sure to port it over

Gregory Schier
Gregory Schier
Gregory Schier
Type to search feedback...