Skip to main content

Admin API Application Config

The authorizationApi.application.config parameter is used to define the main elements for the Authorization Server API - the administrative API for the Authorization Server. Without clearly defining these parameters, the setup of the AS API will fail and limit the integration of the other parties with the Authorization Server.

Below is a sample code block illustrating the common values defined in authorizationApi.application.config followed by a table that provides details and descriptions for each sub-parameter. The most important configuration is to ensure that the Authorization Server API database section points to the same database as the Authorization Server.

Note that the values shown for spring.datasource.username and spring.datasource.password are placeholders and should be replaced with credentials for the specific database used in your deployment.

server.port: 8080
server.error.include-binding-errors: ALWAYS
server.error.include-exception: true
server.error.include-message: ALWAYS
server.error.include-stacktrace: ALWAYS

management:
endpoint:
health:
livenessState.enabled: true
readinessState.enabled: true
probes:
enabled: true
endpoints:
web:
exposure:
include: "health"

logging:
level:
com.sbic.idn: DEBUG
org.springframework.web: DEBUG
org.hibernate.SQL: DEBUG
org.hibernate.type: TRACE

spring.jpa.properties.hibernate.format_sql: true

as-admin:
staticTokens:
- {{AS_ADMIN_STATIC_TOKEN}}
- {{ANOTHER_AS_ADMIN_STATIC_TOKEN}}

spring:
session:
store-type: jdbc
jdbc:
initialize-schema: always
table-name: SPRING_SESSION
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://fpx-staging-fpx-mysql.fpx-staging.svc.cluster.local:3306/authserver
username: {{DATABASE_USERNAME}}
password: {{DATABASE_PASSWORD}}
output.ansi.enabled: ALWAYS
jpa:
generate-ddl: false
hibernate:
ddl-auto: validate
show-sql: true
naming.physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl

elide:
modelPackage: 'com.sbic.idn.entity'
pageSize: 1000
maxPageSize: 10000
json-api:
path: /json-api
enabled: true
graphql:
path: /graphql/api/v1
enabled: false
swagger:
path: /json-api/openapi
enabled: true
version: "v1.0"
name: AuthServer Admin API

Spring Actuator Configuration

Make the following configurations to enable Spring Actuator and monitor the health of the Authorization Server. By default, these

ParameterDescriptionSuggested ValueRequired
management.endpoint.health.livenessState.enabledThis parameter configures whether the liveness state health check is enabled or not.trueNo
management.endpoint.health.readinessState.enabledThis parameter configures whether the readiness state health check is enabled or not.trueNo
management.endpoint.health.probes.enabledThis parameter configures whether the liveness and readiness probes are enabled or disabled. The value should be in Boolean, which means when the value is set to "true", the health probes will be enabled. This parameter is inter-related to the management.endpoint.health.livenessState.enabled and management.endpoint.health.readinessState.enabled parameters described above which means that the value of one of these parameters along with the value of management.endpoint.health.probes.enabled must be set to true for the functionality to work.trueNo
endpoints.web.exposure.includeThere are various actuator endpoints that allow us to monitor and interact with the application. Each endpoint can be enabled and disabled individually. This parameter allows us to configure the specific actuator endpoint that we need enabled. In this case, the "health" endpoint is being enabled to get information on the health of the application.healthNo

Logging and Response Output

These settings control what should be logged and at what level of detail, as well as the information returned in Authorization Server Admin API error responses. Because this is an Admin API, we are not concerned with stack traces and application internals being returned in responses. Therefore, these can be left as default for the majority of use cases.

ParameterDescriptionSuggested ValueRequired
server.error.include-binding-errorsThe server will not be prevented from including binding errors in error response payloads.ALWAYSNo
server.error.include-exceptionThe server will not be prevented from including exceptions in error response payloads.trueNo
server.error.include-messageThe server will not be prevented from including messages in error response payloads.ALWAYSNo
server.error.include-stacktraceThe server will not be prevented from including stack traces in error response payloads.ALWAYSNo
logging.level.com.sbic.idnControls the level at which the Authorization Server Admin API logs will be output.DEBUGNo
logging.level.org.springframework.webControls the level at which the Spring framework Web logs will be output.DEBUGNo
logging.level.org.hibernate.SQLControls the level at which the Hibernate framework SQL logs will be output.DEBUGNo
logging.level.org.hibernate.typeControls the level at which the Hibernate framework SQL binding type logs will be output.DEBUGNo
spring.jpa.properties.hibernate.format_sqlThis will format the SQL that is output to the logs to make it more readable.trueNo

Authentication Token Configuration

ParameterDescriptionSuggested ValueRequired
as-admin.staticTokensDefines an array of values for static authorization tokens. The Authorization Server Admin API will expect one of these values to be included as an Authorization header on all requests.a UUIDYes

Database Configuration

Database configuration for the Authorization Server API.

ParameterDescriptionSuggested ValueRequired
spring.session.store-typeSession store type.jdbcNo
spring.session.jdbc.initialize-schemaDatabase schema initialization mode.alwaysNo
spring.session.jdbc.table-nameName of the database table used to store sessions.SPRING_SESSIONNo
spring.datasource.driver-class-nameMySQL Driver name.com.mysql.cj.jdbc.DriverYes
spring.datasource.urlDriver to use for DB connections.jdbc:mysql://fpx-staging-fpx-mysql.fpx-staging.svc.cluster.local:3306/authserverYes
spring.datasource.usernameUsername for database connection.rootYes
spring.datasource.passwordPassword for database connection.passwordYes
spring.jpa.hibernate.dialectSpring hibernate dialect (only MySQL supported).org.hibernate.dialect.MySQL5InnoDBDialectYes
spring.jpa.generate-ddlA flag that determines whether a SQL Database should be initialized at start-up.falseYes
spring.jpa.hibernate.ddl-autoThere are two options to manage the underlying database schema when working with JPA and Hibernate (leveraged by all backend IDENTOS components):
1) You can encapsulate schema changes in migration scripts and use a tool, like Flyway, to apply the migration scripts upon starting the application. This is the method we will use to generate and update the schema for the authorization server and the Admin Server.
2) You can generate or update the database schema from the JPA and Hibernate entity mappings (extrapolate the domain classes/entity mappings of the deployed server and auto generate the database schema). We will not use this method to generate the schema for any of the components. This is why the value for this field should be set to "validate" as this option instructs Hibernate to ONLY validate the underlying database schema against the entity mappings.
validateYes

JSON API Configuration

The parameters under the elide section are used to expose JSON APIs and configure their URL paths. IDENTOS recommends that these be left at the default values. For more information, refer to Elide Setup.