Skip to content

Configuration

Tom Seidel edited this page Apr 23, 2022 · 2 revisions

To use the project in your application you have to configure users, grants and applications. simple-oauth-server itself provides no user-interface for configuration, but a REST-interface, that can be used to configure the data.

If you're running your instance on http://localhost:8080, a swagger-definition is available at http://localhost:8080/auth/swagger/swagger.json. This file can be used for any swagger-ui tooling (for example https://editor.swagger.io/) to easily setup the data.

The configuration REST-API uses the project it self to authorize the API-operations, that means you need a valid access token for any API configuration operation. The access token needs the grant data.superadmin to configure all data. To create an access token via the Client-Crendtial-Flow see the Getting started Guide

Using the console-application

The project provides a simple console-application to configure all aspects of the server-application. Please visit the Project-Page and download the latest version.

Connect to your simple-oauth-server instance

Start the console with the command

java -jar simple-oauth-config-client-<VERSION>.jar

The initial state of the console will be not-connected.

not_connected

To login to your instance type the following command

login --endpoint http://localhost:8080 --client-id KeCriFQDh8laenwB7RtqAiuffZzK9wSu --client-secret Vmza41wSGaDtVFAUpz8PyfLmjKXsfYaXrvduU6NLfschVc0dfrq124bG5kDxIgFc

where client-id and client-secret are the credentials of the application that was created during application-initialization.

The output should be something like

connected

As soon the configuration console is successfully connected to your server the prompt show the target server as command-prefix.

To get familiar with the available commands of the console press TAB and read the documentation of the available commands, e.g. you can list now all applications

example_applications