Skip to content

Setting Initial Super Client for User Authentication

Eliza Margaretha edited this page Apr 11, 2024 · 2 revisions

For initial user authentication, Kustvakt supports OAuth2 authentication token request mechanism by using passwort grant (see OAuth2 token) web-service. To perform such requests, Kustvakt requires an initial super client which can be automatically registered at server start.

  1. Create a json file with name initial_super_client.json in the data folder at the project root.
$ cd data
$ touch initial_super_client.json

The json file should contain the client properties similar to the request body in the OAuth2 client registration web-service. For instance:

{
  "name":"initial super client",
  "type": "CONFIDENTIAL",
  "description":"initial super client for user authentication"
}
  1. Add the following property in the kustvakt.conf file.
oauth2.initial.super.client=true

The configuration file should be placed in the data folder. An example can be found at: /Kustvakt-full/src/main/resources/kustvakt.conf

  1. Start the Kustvakt jar (usually located at the target folder)
java -jar target/Kustvakt-full-*.jar

A file containing a super client id and a super client secret should be generated at data/super_client_info. For instance:

{
    "client_id": "TmhrfP9GF3h6TNp99HLH6h",
    "client_secret": "ER_Nvy8BvWsPGXpSdxmJ7Q"
}
Clone this wiki locally