Authenticate requests
To connect to IPFS, Infura requires the use of Basic authentication in the Authorization HTTP header. Basic authentication involves sending a base64-encoded string that contains your username and password.
To access the IPFS network through Infura, you'll need to add a billing card to your account, even if you're using a free account. Refer to the billing details for more information.
The format for the Authorization header is as follows:
Authorization: Basic <base64(USERNAME:PASSWORD)>
Username is the API_KEY
and password is the API_KEY_SECRET.
Find your authorization credentials in the API key's settings
page after you register your Infura account and
create an API key that includes the IPFS network.
For example, to authenticate and upload a file to IPFS using cURL, you would use the following command:
curl -X POST -F file=@myfile -u "<API_KEY>:<API_KEY_SECRET>" "https://ipfs.infura.io:5001/api/v0/add"
cURL automatically generates the authorization header and encodes your credentials.