#
# Copyright (c) 2019, 2020 Oracle and/or its affiliates. All rights reserved.
#
# 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: "some client secret"
    # 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"
  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: "${ALIAS=security.properties.oidc-issuer}"
        audience: "${ALIAS=security.properties.oidc-audience}"
        client-id: "${ALIAS=security.properties.oidc-client-id}"
        client-secret: "${ALIAS=security.properties.oidc-client-secret}"
        identity-uri: "${ALIAS=security.properties.oidc-identity-uri}"
        frontend-uri: "${ALIAS=security.properties.frontend-uri}"