Authentication

To authenticate your requests to the Claims and Credentials API, follow these steps:

  1. Create a new .env file in the directory where you plan to run the Docker instance.

  2. Open the .env file in a text editor and add the following content:

    PORT=3000
    AUTHORIZATION="Bearer <your-auth-token>"
    # ============Claims============
    # whether to include the claims module, credentials module is required for this
    ENABLE_CLAIMS=true
    # To get claim queries from
    BLOCKSYNC=""
    # To upload claims to and use cid as id and proof
    CELLNODE=""
    RPC_URL=""
    # to generate secp wallet that will be used for claim to chain interactions
    SECP_MNEMONIC=""
    # ==========Credentials==========
    # whether to include the credentials module
    ENABLE_CREDENTIALS=true
    # issuer did for issuing verifyable credentials, ensure the below mnemonics edkeys is added
    # to the dids verification methods for method 'assertionMethod' on chain
    ISSUER_DID="did:x:zQ3shne9kEBA4Q8mQr5em3NF9mgE8zLXiHGMydLeDqPvbMo7c"
    # to generate ed key that will be used for credential signing
    CREDENTIALS_MNEMONIC="draw enable truly decorate blur negative easily manage hand dog absurd convince"
    # "devnet" or "testnet" or "mainnet"
    NETWORK=""
    # remote contexts to be fetched on startup to be added to the ld credential context resolver
    REMOTE_CONTEXTS=["https://w3id.org/ixo/context/v1"]
    # ==========Tokens==========
    # whether to include the tokens module
    ENABLE_TOKENS=true

    Replace <your-auth-token> with your own bearer authentication token.

  3. Save the .env file.

  4. Start the Docker container with the following command:

    docker run --env-file .env -p 3000:3000 ghcr.io/emerging-eco/emerging-claims-credentials:v0.0.2

    This command starts the Docker container, passing the environment variables from the .env file and mapping the container's port 3000 to your local machine's port 3000.

  5. You can now make authenticated API requests to the Claims and Credentials API running on http://localhost:3000.

Last updated