Skip to content

Authentication

OxiCloud ships with JWT-based authentication and Argon2id password hashing for local accounts. It also exposes status and OIDC-related auth endpoints under the same /api/auth namespace.

Core Endpoints

MethodEndpointDescription
POST/api/auth/registerCreate a local user account
POST/api/auth/loginExchange username and password for access and refresh tokens
POST/api/auth/refreshRefresh the session tokens
GET/api/auth/meReturn the current authenticated user
PUT/api/auth/change-passwordChange the current user's password
POST/api/auth/logoutInvalidate the current session
GET/api/auth/statusReturn auth system state, including OIDC availability

OIDC Endpoints Under Auth

MethodEndpointDescription
GET/api/auth/oidc/providersList configured OIDC provider info
GET/api/auth/oidc/authorizeBuild the authorization redirect URL
GET/api/auth/oidc/callbackHandle provider redirect callback
POST/api/auth/oidc/exchangeExchange the auth code for OxiCloud session tokens

Example Flows

Register

json
{
  "username": "testuser",
  "email": "test@example.com",
  "password": "SecurePassword123"
}

Login

json
{
  "username": "testuser",
  "password": "SecurePassword123"
}

Typical successful login response:

json
{
  "accessToken": "...",
  "refreshToken": "...",
  "expiresIn": 3600
}

Current User

GET /api/auth/me returns the authenticated user's identity, role, and storage information.

Security Model

  • local passwords are hashed with Argon2id
  • access control is role-based (admin and user)
  • refresh tokens support session renewal without forcing frequent re-login
  • OIDC can coexist with local auth or disable password login entirely

Released under the MIT License.