readmeio / readmeio/api

Authorization Headers are not supported

Open
#701 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted
Dominant language
TypeScript
Stars
697
Forks
31
Avg merge
3d 21h
Merged PRs (30d)
10

Description

I am trying to use api to make request to Alpaca. The Readme.io demo page shows me that I can add Authorization Headers for the API Key & API Secret. When I follow the example, my code crashes with the following message:

Error: Sorry, this operation currently requires multiple forms of authentication which this library doesn't yet support.

Here is the example:

import api from 'api';
const sdk = api('@testalpacadocs/v1#zryj16ll4d1dl0');

sdk.auth(process.env.API_KEY);
sdk.auth(process.env.API_SECRET);

await sdk.postOrder({side: 'buy', type: 'market', time_in_force: 'day'});

Screenshot

image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the example using sdk.auth with API_KEY and API_SECRET, then trace the authentication handling reached by sdk.auth and sdk.postOrder. Done means the generated client accepts both credentials as Authorization headers and the Alpaca request no longer fails with the multiple-authentication error.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, authentication
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.