I am trying to authorize with an external API and they have a unique setup where you can generate a token which is then supposed to be used as the password portion of a Basic authorization, where the username is empty. In the end, the authorization header looks something like this:
Authorization: Basic BASE64TOKENSTRING
where BASE64TOKENSTRING
is the :<token>
converted to base64.
I have tried a few different things and can’t seem to find a way to make this work.
Attempt 1: Use the WebBasic Authorization type
This would be the easiest option by far, except that Coda doesn’t currently support an empty username field. There is an argument for “username only”, but no such option for having “password only”
Attempt 2: Use CustomHeaderToken Authorization type
I tried this method, having the custom header be “Authorization” and a tokenPrefix of “Basic :”, but then I don’t have a way to convert the username/password portion to base64.
Attempt 3: Use Custom Authorization type
I then tried using the Custom Auth type, and having the user provide the token as a secret, but I run into issues when I try to convert this to Base64. I am able to get everything formatted together, but there doesn’t seem to be any way for me to specify that I want to convert a portion of the header value to Base64 after the invocationToken is resolved. If I try to convert in my execute function, it simply converts the invocation token string template to base64 instead of resolving the parameter value.
Any ideas how I can make this work? Or maybe there is an opportunity to expand on the current WebBasic Authorization type to allow an empty username field?