Page 1 of 1

http_setAuth only supports 80 char username

Posted: Thu Nov 03, 2022 3:07 am
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!

Re: http_setAuth only supports 80 char username

Posted: Thu Nov 03, 2022 11:45 pm
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