Account Service API
Reference for the Kaleron authentication & account-linking endpoints.
Base URL · https://auth.kaleron.org/Authentication
/api/authRegistration, login, and session management. Sessions are carried by a token cookie (HttpOnly, SameSite=Lax, 48-week lifetime).
Creates a new account and signs the user in immediately.
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
next | string | optional | URL to redirect to after registration. Defaults to the login page. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
email | string | required | Account email address. |
username | string | required | Unique username. |
password | string | required | Plaintext password (hashed with Argon2 server-side). |
Example request
POST /api/auth/register
Content-Type: application/json
{
"email": "[email protected]",
"username": "your_handle",
"password": "••••••••"
}
Responses
Note: error cases currently return HTTP 200 with a message field rather than a 4xx status.
Renders the sign-in / sign-up page.
Responses
Authenticates a user by email or username and issues a session cookie.
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
next | string | optional | Redirect target after successful login. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
input1 | string | required | Email address or username. |
password | string | required | Account password. |
Example request
POST /api/auth/login
Content-Type: application/json
{
"input1": "[email protected]",
"password": "••••••••"
}
Responses
Clears the session cookie and redirects to the login page.
Responses
Account Linking
/api/linkOAuth-style flow that lets a third-party application request access to a Kaleron account. The user is asked to authorize a set of permissions, then redirected back to the calling application with a short-lived exchange code. Data-reading endpoints require that the link's creator_token was granted the matching permission.
Returns the email address of the account bound to a link token, provided the creator token holds the read_email permission.
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
token | string | required | Link token identifying the authorized account. |
Example request
GET /api/link/getUserEmail?token=a1b2c3d4e5
Responses
Returns the username of the account bound to a link token, provided the creator token holds the read_username permission.
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
token | string | required | Link token identifying the authorized account. |
Example request
GET /api/link/getUsername?token=a1b2c3d4e5
Responses
Returns the connection identifier of the linked account, provided the creator token holds the read_username permission.
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
token | string | required | Link token identifying the authorized account. |
Example request
GET /api/link/getConnections?token=a1b2c3d4e5
Responses
Renders the authorization consent page for a given link request.
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
creator_token | string | required | Identifier of the link token created by the third-party application. |
Responses
Confirms the authorization: records the link, generates an exchange code (valid 60 s in Redis) and redirects to the application's accept_redirect_uri.
Form parameters
| Field | Type | Required | Description |
|---|---|---|---|
creator_token | string | required | Identifier of the link token to authorize. |
Responses
Declines the authorization request and redirects the user back to the application's refused_redirect_uri without issuing any code.
Form parameters
| Field | Type | Required | Description |
|---|---|---|---|
creator_token | string | required | Identifier of the link token to decline. |
Responses
Exchanges a short-lived code (received on the redirect) for the persistent link token used to read account data.
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
code | string | required | Exchange code returned to accept_redirect_uri (valid 60 s, single use). |
Example request
GET /api/link/getTokenViaCode?code=a1b2c3d4e5
Responses
Note: the missing-code and invalid-code cases currently return HTTP 200 with a message field rather than a 4xx status. The returned token can then be used with the getUserEmail, getUsername and getConnections endpoints.
Service
/api/accountsConvenience endpoints exposed by the website backend that proxy the Kaleron account service on behalf of the currently signed-in user.
Fetches the accounts linked to the current session by forwarding the token cookie to the upstream account service.
Responses