Skip to main content

Configuration

STOPnik configuration is a simple YAML file.

By default STOPnik will use the config.yml in the same directory as the executable.

The possible configuration options are listed in the next section.

warning

As STOPnik is under heavy development right now, the configuration may change.

Configuration file

The configuration file (e.g. config.yml) may contain different root options which are described here as followed

PropertyDescriptionRequired
serverServer configurationYes
uiUser interface configurationNo
clientsList of clientsYes
usersList of usersYes
classificationClassificationNo

Server configuration

Root entry named server

PropertyDescriptionRequired
logLevelLog levelNo
addrGo like address, may contain IP and portYes
cookiesConfiguration related to cookie namesNo
secretServer secretNo
privateKeyGeneral RSA or EC private key (can be overwritten for each client) to sign tokensNo
tlsConfiguration for TLSNo
logoutRedirectWhere to redirect user after logoutNo
introspectScopeScope which allows token introspectionNo
revokeScopeScopeScope which allows token revocationNo
sessionTimeoutSecondsSeconds until session will endNo
issuerIssuerNo
forwardAuthTraefik ForwardAuth configurationNo

TLS

Public and private keys to sign tokens

Entry server.tls

PropertyDescriptionRequired
addrGo like address, may contain IP and portYes
keysPublic and private keys for TLSYes
TLS keys

Public and private keys for TLS

Entry server.tls.keys

PropertyDescriptionRequired
certCertificate fileYes
keyKey fileYes

Cookies

Public and private keys to sign tokens

Entry server.cookies

PropertyDescriptionRequired
authNameName of the authorization cookieNo
messageNameName of internal message cookieNo
forwardAuthNameName of internal ForwardAuth cookieNo

ForwardAuth

STOPnik supports Traefik ForwardAuth out of the box.

Entry server.forwardAuth

PropertyDescriptionRequired
endpointInternal endpoint to be called by TraefikNo
externalUrlURL of STOPnik to redirect the user for a loginNo
parameterNameURL parameter used by STOPnik for ForwardAuthNo
redirectsList of redirects URIsNo

User interface configuration

Root entry named ui

PropertyDescriptionRequired
hideFooterWill hide the STOPnik footerNo
hideLogoWill hide the STOPnik logoNo
htmlTitleHTML page titleNo
titleTitle displayed above the formsNo
footerTextThe footer textNo
logoImagePath of additional logo imageNo
invalidCredentialsMessageMessage to show for invalid credentialsNo
expiredLoginMessageMessage to show when login expiredNo

Clients

List of clients

Root entry clients

Each entry may contain the following options

PropertyDescriptionRequired
idThe id of the clientYes
clientSecretSHA512 hashed secretNo
saltOptional salt for secret to avoid identical hash valuesNo
oidcFlag to allow an client to handle OpenId ConnectNo
accessTTLAccess token time to liveNo
refreshTTLRefresh token time to liveNo
idTTLOpenId Connect ID token time to liveNo
introspectIntrospection scopeNo
revokeRevocation scopeNo
redirectsList of redirects URIsNo
opaqueTokenUse opaque tokenNo
passwordFallbackAllowedForm auth allowedNo
audienceAudienceNo
privateKeyRSA or EC private key to sign tokensNo

For clientSecret and salt see, Command line - Password

If no clientSecret is provided, the client is handled as public client, otherwise it will become a confidential client.

Users

List of users

Root entry users

Each entry may contain the following options

PropertyDescriptionRequired
usernameUsernameYes
passwordSHA512 hashed passwordYes
saltOptional salt for password to avoid identical hash valuesNo
userProfileUser profile which will be used for OpenId Connect UserInfoNo
userInformationUser information which will be used for OpenId Connect UserInfoNo

For password and salt see, Command line - Password

User profile

User profile which will be used for OpenId Connect UserInfo

Entry users[n].userProfile

Each entry may contain the following options

PropertyDescriptionRequired
givenNameGiven nameNo
familyNameFamily nameNo
nicknameNicknameNo
preferredUserNamePreferred usernameNo
genderGenderNo
birthDateBirthdateNo
zoneInfoZone informationNo
localelocaleNo
websiteWebsite URLNo
profileProfile URLNo
pictureProfile picture URLNo

User information

User information which will be used for OpenId Connect UserInfo

Entry users[n].userInformation

Each entry may contain the following options

PropertyDescriptionRequired
emailE-Mail addressNo
emailVerifiedE-Mail address verification flagNo
phoneNumberPhone numberNo
phoneVerifiedPhone number verification flagNo
addressUser addressNo

User address

User address which will be used for OpenId Connect UserInfo

Entry users[n].userInformation.address

Each entry may contain the following options

PropertyDescriptionRequired
streetStreetNo
cityCityNo
postalCodePostal codeNo
regionRegionNo
countryCountryNo

Classification

List of classification entries

Root entry classification

A classification entry allows to add specific claims to access token (if is a JWT), to ID token and to the user info endpoint described in OpenID Connect Core 1.0

When scope or scopes are used, the listed claims will only be returned if the scope was requested.

Each entry may contain the following options

PropertyDescriptionRequired
userA specific userNo
usersList of usersNo
clientA specific clientNo
clientsList of clientsNo
scopeA specific scopeNo
scopesList of scopesNo
claimsList of claimsNo

The options for user + users, client + clients, scope + scopes will be merged into one specific list.

So the single value may be considered as shortcut, if you do not need a list at all.

Values for user + users, client + clients, scope + scopes will be used in a distinct manner.

Claims

List of client claims

Entry classification[n].calims

Each entry may contain the following options

PropertyDescriptionRequired
nameNameYes
scopeA specific scopeNo
scopesList of scopesNo
valueA specific valueYes, if values not used
valuesList of valueYes, if value not used

The options for scope + scopes will be merged into one list.

So the single value may be considered as shortcut, if you do not need a list at all.

Values for scope + scopes will be used in a distinct manner.

When claim scopes are used, the listed claims will only be returned if the scope was requested.

If the parent classification has set scopes the scopes are used in addition to the claim scopes.

Examples

Minimal configuration

The shown config.yml is the minimal version possible.

It only defines the HTTP port STOPnik should listen on, one client and one user.

After starting locally with this configuration, STOPnik will be accessible at

server:
addr: :8080
clients:
- id: testclient
clientSecret: d82c4eb5261cb9c8aa9855edd67d1bd10482f41529858d925094d173fa662aa91ff39bc5b188615273484021dfb16fd8284cf684ccf0fc795be3aa2fc1e6c181
redirects:
- https://oauth.pstmn.io/v1/callback
users:
- username: foo
password: d82c4eb5261cb9c8aa9855edd67d1bd10482f41529858d925094d173fa662aa91ff39bc5b188615273484021dfb16fd8284cf684ccf0fc795be3aa2fc1e6c181

Development configuration

The shown config.yml is used during development and can be found in the repository.

https://github.com/webishdev/stopnik/blob/main/config.yml

This configuration uses self-singed TLS certificates, keys and a privates key located in the .test_files folder.

server:
# logLevel: debug
cookies:
authName: stopnik_auth
messageName: stopnik_message
#logoutRedirect: http://localhost:8080
forwardAuth:
externalUrl: http://localhost:9090
#externalUrl: http://stopnik.localhost:9090 #ext
redirects:
- http://localhost:9090*
- http://whoami.localhost:9090*
secret: WRYldij9ebtDZ5VJSsxNAfCZ
privateKey: ./.test_files/rsa256key.pem
addr: :8082
tls:
addr: :8081
keys:
cert: ./.test_files/server.crt
key: ./.test_files/server.key
ui:
# hideFooter: true
# hideLogo: true
# footerText: Some nice line!
# title: Test realm
clients:
- id: testclient
clientSecret: 43a77b3b7f74190654023e68a972b4b0dc21a90be9b85e80222d7bce31eb02ce3205a5fed49a7710afd0ba1fcb97b793d67b5b7ae69607461cdac1a235610dd8
salt: 123
accessTTL: 5
refreshTTL: 15
idTTL: 15
oidc: true
introspect: true
redirects:
- https://oauth.pstmn.io/v1/callback
- http://localhost:8080/session/callback
- http://localhost:5173/reporting/oidc-callback*
- http://localhost:8082/health
- id: testclient2
clientSecret: deb920477e822d9373831d5521749d3685a3c359504139eb3ff61c7d2fe91986b1978aa1a7834bb304762699b05da2700319e5d60c1183f6f9f66f9c6e73e34e
salt: abc
accessTTL: 5
refreshTTL: 15
opaqueToken: true
redirects:
- https://oauth.pstmn.io/v1/callback
- id: testclient3
clientSecret: 1efcbc37f7d7e2f9f8cf009b91c95b2b7b913b89d36a21a05da1e3cb396ed1ab0e596e2b649e9407367e40d852ac4d0abfcfc1c4227eb661385e9f2e0f3203ca
salt: 321
accessTTL: 5
refreshTTL: 15
privateKey: ./.test_files/ecdsa521key.pem
redirects:
- https://oauth.pstmn.io/v1/callback
users:
- username: foo
password: 695e6f39f5ffd36ae60e0ade727c892d725531455a19c6035cb739d099e8f20e63d3fdfd3241888e38de1d8db85532dd65f817b12fe33ac7cdcc358ef6c8ea23
salt: moo
roles:
testclient:
- foo_role
- bar_role
userProfile:
givenName: John
familyName: Doe
userInformation:
email: jone.doe@foo.com
emailVerified: true
phoneNumber: 555 1234 5678
phoneVerified: true
address:
street: Mainstreet 1
city: Sometown
postalCode: 12345
country: Boom
classification:
- user: foo
users: ['foo', 'bar', 'moo'] # 2nd definition of 'foo', will only be used once
client: testclient
scope: my_scope
claims:
- name: some
value: some_value
scope: blabla
- name: other
values:
- abc
- def