Authentication Client does not work
evanfuller opened this issue · comments
Evan Fuller commented
The CreateToken
endpoint uses the same underlying impl request helper function as all other API endpoints in this package.
This implementation is hard-coded to use the Bearer prefix when making requests.
Notion's public docs for this endpoint define that it uses the Basic
prefix, where the token is the base64-encoded concatenation of an OAuth app's client ID and secret.
Two possible fixes are:
- Band-aid fix by using the
Basic
prefix for this endpoint only, and expect library users to pass in the base64-encoded token. - Implement a richer
Token
type that can support bothBearer
andBasic
cases, the latter of which could include struct fields for ID + Secret, and implement the base64 encoding in this library.
Anatoly Nosov commented
fixed in #145