svix / svix-webhooks

The enterprise-ready webhooks service 🦀

Home Page:https://www.svix.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Authorization Bearer Token Issues ...

vidcentum opened this issue · comments

Bug Report

Step 1:Running svix-server in Docker

File: docker-compose.yml

image: svix/svix-server
environment:
      WAIT_FOR: "true"  # We want to wait for the default services
      SVIX_JWT_SECRET: "<secret>" 
      SVIX_REDIS_DSN: "redis://redis:6379"
      SVIX_DB_DSN: "< ... >"

Used config.toml while `docker compose up`.

I am able to run the server with docker compose up

Step 2: Generation of JWT token

$ docker exec -it server-backend-1  /bin/bash
appuser@f731ad956895:/$ svix-server jwt generate

Token (Bearer):  Token was generated.

Step 3: Token verification

Using https://jwt.io/ , the token was verified. 

Payload:
{
  "iat": 1708531052,
  "exp": 2023891052,
  "nbf": 1708531052,
  "iss": "svix-server",
  "sub": "org_23rb8YdGqMT0qIzpgGwdXfHirMu"
}

Step 4: Application creation using curl.

curl -X 'POST' 'https://api.vidcentum.com/api/v1/app/' \
  -H 'Authorization: Bearer  <TOKEN GENERATED in Step 2 above using svix-server jwt generate ' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
    "uid": "vt-ai-api-app",
    "name": "VT AI Application",
    "rateLimit": 1000
}'

Expected Behavior: Creation of Application

Actual behavior: {"code":"authentication_failed","detail":"Invalid token"}

I tried several times (generating new JWT token and changing the secret in config.toml, but could not create the application.

I am installing Svix first time. I think I am missing a step. Please help in resolving the issue.

I tried to build locally and followed the steps in the document.

Now I am able to create applications.

Thank you. My apologies to bother you.

I am closing the issue.