LogoLogo
GitHubWebsite
  • Documentation
  • Client API
  • Application API
  • Client API
  • Authentication
  • Users
  • API Keys
  • Nodes
  • Allocations
  • Regions
  • Units
  • Servers
  • Cargo
  • Projects
  • System
  • Models
Powered by GitBook

© Argon Foundation

On this page

Was this helpful?

Export as PDF

Authentication

PreviousClient APINextUsers

Was this helpful?

Get current authentication state

get

Returns the current user's authentication status and permissions

Authorizations
Responses
200
Authentication state
application/json
401
Not authenticated
application/json
get
GET /api/auth/state HTTP/1.1
Host: localhost:3000
Authorization: Bearer JWT
Accept: */*
{
  "authenticated": true,
  "username": "text",
  "permissions": [
    "text"
  ]
}
  • POSTRegister a new user
  • POSTUser login
  • GETGet current authentication state
  • PUTUpdate user profile

Register a new user

post

Create a new user account

Body
usernamestring · min: 1Required
passwordstring · min: 8Required
Responses
200
User registered successfully
application/json
400
Invalid request
application/json
500
Server error
application/json
post
POST /api/auth/register HTTP/1.1
Host: localhost:3000
Content-Type: application/json
Accept: */*
Content-Length: 37

{
  "username": "text",
  "password": "text"
}
{
  "token": "text",
  "permissions": [
    "text"
  ]
}

User login

post

Login with username and password

Body
usernamestringRequired
passwordstringRequired
Responses
200
Login successful
application/json
401
Invalid credentials
application/json
500
Server error
application/json
post
POST /api/auth/login HTTP/1.1
Host: localhost:3000
Content-Type: application/json
Accept: */*
Content-Length: 37

{
  "username": "text",
  "password": "text"
}
{
  "token": "text",
  "permissions": [
    "text"
  ]
}

Update user profile

put

Update current user's username and/or password

Authorizations
Body
newUsernamestring · min: 1Optional
currentPasswordstringOptional
newPasswordstring · min: 8Optional
Responses
200
Profile updated successfully
application/json
400
Invalid request
application/json
401
Invalid credentials
application/json
500
Server error
application/json
put
PUT /api/auth/profile HTTP/1.1
Host: localhost:3000
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 68

{
  "newUsername": "text",
  "currentPassword": "text",
  "newPassword": "text"
}
{
  "message": "text",
  "token": "text",
  "permissions": [
    "text"
  ]
}