Skip to main content

Authentication via JWT

Secure your API requests using JSON Web Tokens (JWT). This method is ideal for user interactions and temporary sessions.

Login via API

To obtain a JWT, send your credentials to the login endpoint:
curl -X POST https://api.craftingstudiopro.de/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "username": "YourUsername",
    "password": "YourPassword"
  }'

Expected Response

{
  "token": "eyJhbGciOiJIUzI1NiIsInR5...",
  "user": {
    "username": "YourUsername",
    "role": "USER"
  }
}

Using the Token

Include the token in the Authorization header as a Bearer Token.
curl -X GET https://api.craftingstudiopro.de/v1/plugins/my \
  -H "Authorization: Bearer YOUR_TOKEN_HERE"
Security Note: JWTs expire after 24 hours for security reasons. After that, a new login is required. For persistent scripts or server-to-server communication, please use API Keys.