I can't find or delete my working access tokens for R2

I am managing files with R2 using the S3 api (in node). I have created an access key and secret key a long time ago (I can't remember how or where I created them). These credentials got leaked and I want to delete the old ones and create new ones. The problem is that I can't find the access token in the dashboard anywhere, but it still works. The process.env.ACCESS_TOKEN is 32 long with lowercase letters and numbers. The process.env.S3_SECRET_KEY is 64 long with lowercase letters and numbers. I'm using the code below:
const s3 = require('@aws-sdk/client-s3');

const s3Client = new s3.S3Client({
region: 'us-east-1',
endpoint: process.env.S3_ENDPOINT,
credentials: {
accessKeyId: process.env.S3_ACCESS_KEY,
secretAccessKey: process.env.S3_SECRET_KEY
}
});
const s3 = require('@aws-sdk/client-s3');

const s3Client = new s3.S3Client({
region: 'us-east-1',
endpoint: process.env.S3_ENDPOINT,
credentials: {
accessKeyId: process.env.S3_ACCESS_KEY,
secretAccessKey: process.env.S3_SECRET_KEY
}
});
TLDR: I have a working access token for R2 using S3 api, but can't find it in the dashboard.
No description
No description
No description
11 Replies
harshil1712
harshil17123w ago
Heya, did you figure it out? You create the API tokens from the R2 dashboard itself
Oscar
OscarOP3w ago
I haven't figured it out yet. I already have a working api token, but can't find it here. Am I looking in the wrong place?
No description
No description
No description
No description
harshil1712
harshil17123w ago
That's where you should have the tokens. Can you check if this is the correct account? Moreover, it might be that you have caching enabled, which is why you can still access the items from the bucket
Oscar
OscarOP3w ago
This is the correct account with the correct buckets. I do have caching enabled, but can actively create, delete and get new items Sorry for the late response
harshil1712
harshil17123w ago
Looking at the code snippet it feels like you are still using S3, instead of R2? Or maybe it's just the naming?
Oscar
OscarOP3w ago
I'm using R2 with the S3 api provided by Cloudflare. I can see newly created items (with my current token) in the correct account in the buckets in the Cloudflare dashboard
harshil1712
harshil17123w ago
I have not come across this issue before. Asking the team
Oscar
OscarOP3w ago
If anyone sends a message here, please ping me. I'm having some trouble with the discord notification settings
harshil1712
harshil17122w ago
Hey, we will need your account ID to check this. Sorry for the dealy from my end
Oscar
OscarOP2w ago
np it's
2e01a9b3adad6513d50176031863565b
2e01a9b3adad6513d50176031863565b
harshil1712
harshil17122w ago
Thanks! Shared with the team.

Did you find this page helpful?