IPFS Authentication Error 403 - Forbidden

i tried, but always same issue.
basic auth failure: invalid project id or project secret
image

tried with postman, but never solved.
very disappointed with ipfs with infura

How are you defining the projectID and secret in your code ?

i m very disappointed as i tried for 3 days to solve it.

but could not fix it.

i followed the code in the infura docs.

never helped

image

I’m not seeing that key as a valid projectID on our end, did you create it from the infura dashboard Ethereum API | IPFS API & Gateway | ETH Nodes as a Service | Infura - create new key - network = ipfs ?

That’s an Ethereum key, it doesn’t work for IPFS, you need to create a separate one as suggested.

how can i make api key for the ipfs?

yes, exactly like that

Hi, I am not sure if that is relevant to this topic, but I found that I can’t access the link due to the SSL cert in Chrome and firefox. I am using the DEDICATED GATEWAYS

I can only access the link in Safari. It is infinite loading in all the other browsers ERR_CONNECTION_TIMED_OUT

https://next-nft-polygon-testing.infura-ipfs.io/ipfs/QmQMBzHfadX4AVCnvjVXHV8zJHGb8i1zn5EoBUopeqjfhK

I can’t access the demo link on the ipfs page too
https://meme-nft.infura-ipfs.io/ipfs/QmW5sPVbZDueZwvSuibteAwDFwFXhF8gebfptGBx1DZq1j

I just found the issue. I don’t know why my ISP (Sky in the UK) got some unknown problems with those ipfs links(Maybe it is related to SSL?). Once I use my own mobile phone bandwidth, I am able to see the data.

I implemented everything using my dedicated gateway subdomain, but I still cannot make requests. Does anyone know if there is a solution to this issue here? Looking at the above I don’t really see anything that works

doesn’t work with dedicated gateway (I always get an ERR_SSL_PROTOCOL_ERROR, see here):
https://nftschool.infura-ipfs.io/ipfs/QmZdS6ZDYhfmXMJVH6e9MDQyfuL7iifnrNVXJjKZ2vAWWp

but works on IPFS:

The problem seems to be with CORs settings on the Infura server, but they refuse to admit it :smirk:

Technically you can make it work, but there’s a typo in their demo code. The correct header for basic auth should be:

  const client = await create({
    host: 'ipfs.infura.io',
    port: 5001,
    protocol: 'https',
    headers: {
      'Authorization': yourAuthHeader
    }
  });

You will have to go to your Infura project settings and add your User Agent in the security tab. You can determine your user agent by entering console.log(navigator.userAgent) in the JS VM of dev tools for your browser.

Hello,

In the middle of August I got the 401 forbiden error. I managed to correct it.

However, now I have this error again. (403 forbidden)
Do you have any idea how to solve the error?

Request URL: https://sagemarket.infura-ipfs.io/ipfs/xxxxxxxxxxxxxxxxxxxxxxxx
Request mode: GET
Status code: 403 Forbidden
Remote address: 54.227.105.66:443
Provenance URL rules: strict-origin-when-cross-origin

hey, do you have any origin set in that ipfs key allowlist that has the dedicated gateway configured ?

I wasted my whole day to resolve this issue, update code in different ways, finally I create new app on infura and test code with new project id and secret, it is working for me :

JAVASCRIPT CODE :
const projectId = process.env.IPFS_PROVIDER_PROJECTID;
const projectSecret = process.env.IPFS_PROVIDER_PROJECTSECRET;
const ipfsClient = require(‘ipfs-http-client’);

async function main() {
const auth = 'Basic ’ + Buffer.from(projectId + ‘:’ + projectSecret).toString(‘base64’);
const client = await ipfsClient.create({
host: ‘ipfs.infura.io’,
port: 5001,
protocol: ‘https’,
apiPath: ‘/api/v0’,
headers: {
authorization: auth
}
})

try {
const file = await client.add(‘test.png’)
console.log(file)

} catch (error) {
  console.log(error)
}

}
main();


CURL :

curl -X POST -F file=@test.png -u “KKKKKKKEY:SSSSSSECRET” “https://ipfs.infura.io:5001/api/v0/add” --insecure -A “curl”

Take care you may need to use ipfs-http-client@33.0.1.