http_setAuth only supports 80 char username

Discussions related to HTTPAPI (An HTTP Client Package for RPG programming.) http://www.scottklement.com/httpapi/
Post Reply
jsanguin
Posts: 2
Joined: Wed Nov 10, 2021 5:09 pm

http_setAuth only supports 80 char username

Post by jsanguin »

Crazy times! That should be more than enough, but a vendor with cloud solution is asking us to use Basic Authentication with credentials that are bigger than 80 characters each. I see for password we get up to 15000 characters, but for username only 80. Is there a way to overcome this? Thanks!
Scott Klement
Site Admin
Posts: 635
Joined: Sun Jul 04, 2021 5:12 am

Re: http_setAuth only supports 80 char username

Post by Scott Klement »

Currently, if you wanted to make it work with a user name longer than 80 characters, you'd have to do some custom coding.

1) Write a routine that combines the userid/password into a single string separated by a colon. For example "user:password" (without the quotes)
2) base64-encode the string.
3) Build a custom header of "Authorization: Basic <base64-string-here>" (without the quotes or > < characters.)
4) Use the HTTP_xproc for "additional headers" to add it into the http transaction.

This is the first time I've ever heard of a user name longer than 80 characters. If more people are looking for something like this, I will consider adding it to http_setAuth
Post Reply