Authorization Header

View as MarkdownOpen in Claude

The Authorization Header compiles our full OAuth parameters into an alphabetically-sorted string.

  • Each key/value pair must be added in the format ‘key=“value”, where each value is surrounded with quotes
  • Each pair separated with a comma.
  • The string must be prepended with “OAuth ”.

The final string should be added as a header for your request using the “Authorization” header.

1# Assemble oauth params into auth header value as comma-separated str.
2oauth_header = "OAuth " + ", ".join([f'{k}="{v}"' for k, v in sorted(oauth_params.items())])
3
4# Create dict for LST request headers including OAuth Authorization header.
5headers = {"Authorization": oauth_header}