#
# Copyright (c) 2019, 2024 Oracle and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

server:
  port: 7987
security:
  config.require-encryption: false
  properties:
    # this should be defined by the identity server
    oidc-identity-uri: "https://tenant.some-server.com/oauth2/default"
    # when you create a new client in identity server configuration, you should get a client id and a client secret
    oidc-client-id: "some client id"
    oidc-client-secret: "changeit"
    # issuer of the tokens - identity server specific (maybe even configurable)
    oidc-issuer: "https://tenant.some-server.com/oauth2/default"
    # audience of the tokens - identity server specific (usually configurable)
    oidc-audience: "configured audience"
    # The frontend URI defines the possible load balancer address
    # The redirect URI used is ${frontend-uri}${redirect-uri}
    # Webserver is by default listening on /oidc/redirect - this can be modified by `redirect-uri` option in oidc configuration
    frontend-uri: "http://localhost:7987"
    server-type: "@default"
  providers:
    - abac:
      # Adds ABAC Provider - it does not require any configuration
    - oidc:
        # use a custom name, so it does not clash with other examples
        cookie-name: "OIDC_EXAMPLE_COOKIE"
        # support for "Authorization" header with bearer token
        header-use: true
        # the default redirect-uri, where the webserver listens on redirects from identity server
        redirect-uri: "/oidc/redirect"
        issuer: "${security.properties.oidc-issuer}"
        audience: "${security.properties.oidc-audience}"
        client-id: "${security.properties.oidc-client-id}"
        client-secret: "${security.properties.oidc-client-secret}"
        identity-uri: "${security.properties.oidc-identity-uri}"
        frontend-uri: "${security.properties.frontend-uri}"
        server-type: "${security.properties.server-type}"
        # We want to redirect to login page (and token can be received either through cookie or header)
        redirect: true