Search the docs
Menu
Updated Edit on GitHub

Server API: single sign-on

Copy as Markdown

These routes are on the server API, port 21114 (21121 in Docker). They take an API key in X-API-Key or a sign-in token; see The HTTP API.

The LDAP and OpenID Connect settings of the server and their tests.

GET /api/auth/ldap/config

Show the LDAP settings.

The bind password is masked.

On the server API, port 21114. Needs server.config.

200: Done (application/json)

The LDAP settings

Field Type What it is
enabled boolean
host string Like ldap.example.com
port integer 0 gives 636 with use_tls, else 389
use_tls boolean LDAPS
start_tls boolean STARTTLS on the plain port
skip_tls_verify boolean
bind_dn string The service account that searches
bind_password string Masked as •••••••• in answers
base_dn string
user_filter string Like (sAMAccountName={{username}})
user_attr_id string
user_attr_email string
user_attr_name string
group_base_dn string "" for base_dn
group_filter string Default (member={{dn}})
group_attr_name string
default_role string For people no group line maps
group_role_map string JSON: group DN or name to role
direct_bind boolean Bind with direct_bind_dn instead of searching
direct_bind_dn string Like uid={{username}},ou=users,dc=example,dc=com
conn_timeout_seconds integer 0 gives 10
allow_signup boolean A person the directory accepts gets an account
Error When
401 No credential, or one that is not valid
403 The credential's role lacks the permission

PUT /api/auth/ldap/config

Save the LDAP settings.

The body replaces the settings. Without bind_password, or with the mask ••••••••, the stored password stays; "" clears it. Without allow_signup it stays as it is. Settings that are on are checked first: a broken filter or role map line is refused with its field.

On the server API, port 21114. Needs server.config.

Request body, application/json:

The LDAP settings

Field Type What it is
enabled boolean
host string Like ldap.example.com
port integer 0 gives 636 with use_tls, else 389
use_tls boolean LDAPS
start_tls boolean STARTTLS on the plain port
skip_tls_verify boolean
bind_dn string The service account that searches
bind_password string Masked as •••••••• in answers
base_dn string
user_filter string Like (sAMAccountName={{username}})
user_attr_id string
user_attr_email string
user_attr_name string
group_base_dn string "" for base_dn
group_filter string Default (member={{dn}})
group_attr_name string
default_role string For people no group line maps
group_role_map string JSON: group DN or name to role
direct_bind boolean Bind with direct_bind_dn instead of searching
direct_bind_dn string Like uid={{username}},ou=users,dc=example,dc=com
conn_timeout_seconds integer 0 gives 10
allow_signup boolean A person the directory accepts gets an account

200: Done (application/json)

Field Type
status "ok"
Error When
400 The body is no JSON, or a setting is wrong; field names it
401 No credential, or one that is not valid
403 The credential's role lacks the permission

POST /api/auth/ldap/test

Test LDAP settings against the directory without saving them.

The body is the settings to test. Without a password, or with the mask, the stored one is used, but only for the stored host and bind DN. A failed test answers 200 with success false.

On the server API, port 21114. Needs server.config.

Request body, application/json:

The LDAP settings

Field Type What it is
enabled boolean
host string Like ldap.example.com
port integer 0 gives 636 with use_tls, else 389
use_tls boolean LDAPS
start_tls boolean STARTTLS on the plain port
skip_tls_verify boolean
bind_dn string The service account that searches
bind_password string Masked as •••••••• in answers
base_dn string
user_filter string Like (sAMAccountName={{username}})
user_attr_id string
user_attr_email string
user_attr_name string
group_base_dn string "" for base_dn
group_filter string Default (member={{dn}})
group_attr_name string
default_role string For people no group line maps
group_role_map string JSON: group DN or name to role
direct_bind boolean Bind with direct_bind_dn instead of searching
direct_bind_dn string Like uid={{username}},ou=users,dc=example,dc=com
conn_timeout_seconds integer 0 gives 10
allow_signup boolean A person the directory accepts gets an account

200: Done (application/json)

Field Type What it is
success boolean
message string
error string
field string The setting that is wrong, when one is
Error When
400 The request is not valid
401 No credential, or one that is not valid
403 The credential's role lacks the permission

GET /api/auth/oidc/config

Show the single sign-on (OpenID Connect) settings.

The client secret is masked.

On the server API, port 21114. Needs server.config.

200: Done (application/json)

The OpenID Connect settings

Field Type What it is
enabled boolean
prefer_sso boolean Start single sign-on at once on the sign-in page
display_name string The button label
issuer_url string
client_id string
client_secret string Masked as •••••••• in answers; the mask in a save keeps the stored secret
redirect_url string
panel_url string The console's address
scopes string Space-separated, default openid profile email
use_pkce boolean
auto_discovery boolean Read the endpoints from .well-known/openid-configuration
authorization_url string
token_url string
userinfo_url string
claim_username string
claim_email string
claim_name string
claim_groups string
default_role string
group_role_map string GroupName=role|GroupName=role
allow_signup boolean
allowed_private_cidrs string Private networks the issuer may be in
Error When
401 No credential, or one that is not valid
403 The credential's role lacks the permission

PUT /api/auth/oidc/config

Save the single sign-on (OpenID Connect) settings.

The body replaces the settings: a field left out is cleared, the client secret too unless the body has the mask ••••••••. An issuer that is no address or that the server may not reach, missing endpoints without auto_discovery and unknown roles are refused with their field.

On the server API, port 21114. Needs server.config.

Request body, application/json:

The OpenID Connect settings

Field Type What it is
enabled boolean
prefer_sso boolean Start single sign-on at once on the sign-in page
display_name string The button label
issuer_url string
client_id string
client_secret string Masked as •••••••• in answers; the mask in a save keeps the stored secret
redirect_url string
panel_url string The console's address
scopes string Space-separated, default openid profile email
use_pkce boolean
auto_discovery boolean Read the endpoints from .well-known/openid-configuration
authorization_url string
token_url string
userinfo_url string
claim_username string
claim_email string
claim_name string
claim_groups string
default_role string
group_role_map string GroupName=role|GroupName=role
allow_signup boolean
allowed_private_cidrs string Private networks the issuer may be in

200: Done (application/json)

Field Type
status "ok"
Error When
400 The body is no JSON, or a setting is wrong; field names it
401 No credential, or one that is not valid
403 The credential's role lacks the permission

POST /api/auth/oidc/test

Read the discovery document of an OpenID Connect issuer.

Nothing is saved. A failed fetch answers 200 with success false.

On the server API, port 21114. Needs server.config.

Request body, application/json:

Field Type Required
issuer_url string yes
allowed_private_cidrs string

200: Done (application/json)

Field Type
success boolean
error string
issuer string
authorization_endpoint string
token_endpoint string
userinfo_endpoint string
Error When
400 The request is not valid
401 No credential, or one that is not valid
403 The credential's role lacks the permission

Type to search pages, sections, commands and settings.