# 4EVER Security Token Service API

## Introduction

The 4EVERLAND Security Token Service is a service designed to generate temporary credentials, allowing you to request temporary credentials for partial or even full privileges for other users or a specified user.

4EVER Bucket STS fully compatible with AWS S3 STS. More information about STS can be found at [AWS S3 STS](https://docs.aws.amazon.com/STS/latest/APIReference/welcome.html).

## How to use

This is obtained by taking the API Secret and the API Key from the Master key and sending them to the endpoint. By default, all 4EVERLAND STS requests are sent to `https://endpoint.4everland.co.`

Javascript example:

```javascript
const {STSClient, AssumeRoleCommand} = require('@aws-sdk/client-sts')

const stsClient = new STSClient({
    endpoint: 'https://endpoint.4everland.co',
    region: 'us-west-1',
    credentials: {
        accessKeyId: 'Your api key.',
        secretAccessKey:  'Your api secret.',
    }
});

const params = {
    RoleSessionName: "only-put-object",
    DurationSeconds: 3600,
    Policy: `{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:PutObject",
                "s3:AbortMultipartUpload"
            ],
            "Resource": [
                "arn:aws:s3:::your-bucket-name/your-directory/*"
            ]
        }
    ]
}`
};


stsClient.send(new AssumeRoleCommand(params)).then(function (data) {
    console.log(data.Credentials)
});
```

## How to get the Master Key

Click on Bucket> Access key> Master-Key

<figure><img src="https://4107147272-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEVHC4TEQKrh3Bfvq5dDi%2Fuploads%2F84y8Q92hSuFzxEVvXh80%2Fimage.png?alt=media&#x26;token=f572c2eb-be31-4360-8abd-410c67890431" alt=""><figcaption></figcaption></figure>

Copy API Key and API Secret

<figure><img src="https://4107147272-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEVHC4TEQKrh3Bfvq5dDi%2Fuploads%2Fvv6SLFyBFFtgpP1BQmJ0%2Fimage.png?alt=media&#x26;token=27ece849-e766-40cd-bd76-1e880b0f9085" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
The API Secret can be reset if there is a security breach, the Master key cannot be deleted.
{% endhint %}

{% hint style="info" %}
If you have any questions, please join our [Discord server](https://discord.com/invite/Cun2VpsdjF), or send us an email at <contact@4everland.org>.
{% endhint %}
