I can’t set the authentication header prefix to be “empty” or “nothing” or “null”. Setting to an empty string forces the default prefix of "Bearer ", and setting to null throws an error during compile. Omitting the parameter again sets the value to the default "Bearer ".
AWS Cognito default Authorizer isn’t set up to handle a token being passed with any kind of prefix. So, to get around this, I will have to create a custom lambda authorizer, which is what I’ve been trying to avoid.
If Coda lets developers supply a tokenPrefix
option, we should also be able to set it to an empty string or “null”.
Thanks.
Code:
// pack.ts
pack.setUserAuthentication({
type: coda.AuthenticationType.OAuth2,
authorizationUrl:
"https://blahblah.auth.us-east-1.amazoncognito.com/oauth2/authorize",
tokenUrl:
"https://blahblah.auth.us-east-1.amazoncognito.com/oauth2/token",
scopes: ["openid", "email"],
tokenPrefix: null,
});
Console output:
# npx coda upload pack.ts
Building Pack bundle...
Validating Pack metadata...
Pack metadata failed validation: [{"path":"defaultAuthentication.tokenPrefix","message":"Expected string, received null"}]:
Error in field at path "defaultAuthentication.tokenPrefix": Expected string, received null