http_setAuth only supports 80 char username
http_setAuth only supports 80 char username
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!
-
- Site Admin
- Posts: 872
- Joined: Sun Jul 04, 2021 5:12 am
Re: http_setAuth only supports 80 char username
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
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