nokia / kong-oidc

OIDC plugin for Kong
Apache License 2.0
454 stars 320 forks source link

Configuration: 'issuer': unknown field #159

Open AMontagu opened 4 years ago

AMontagu commented 4 years ago

Hi !

I am trying to get this plugin working in DB-less mode (I am going to deploy on kubernetes so I want to have all the configuration fixed in a declarative way)

I have installed the plugin in a docker image but the configurations are not recognized.

The error:

kong     | 2020/04/15 15:49:33 [error] 1#0: init_by_lua error: /usr/local/share/lua/5.1/kong/init.lua:431: error parsing declarative config file /usr/local/kong/declarative/kong.yml:
kong     | in 'plugins':
kong     |   - in entry 1 of 'plugins':
kong     |     in 'config':
kong     |       in 'issuer': unknown field
kong     | stack traceback:
kong     |  [C]: in function 'error'
kong     |  /usr/local/share/lua/5.1/kong/init.lua:431: in function 'init'
kong     |  init_by_lua:3: in main chunk
kong     | nginx: [error] init_by_lua error: /usr/local/share/lua/5.1/kong/init.lua:431: error parsing declarative config file /usr/local/kong/declarative/kong.yml:
kong     | in 'plugins':
kong     |   - in entry 1 of 'plugins':
kong     |     in 'config':
kong     |       in 'issuer': unknown field
kong     | stack traceback:
kong     |  [C]: in function 'error'
kong     |  /usr/local/share/lua/5.1/kong/init.lua:431: in function 'init'
kong     |  init_by_lua:3: in main chunk
kong exited with code 1

###################################################################

The kong.yml file:

_format_version: "1.1"

services:
- name: example-service
  url: http://mockbin.org
  routes:
  - name: my-route
    paths:
    - /

consumers:
- username: adrien

plugins:
- name: oidc
  config: 
    issuer: http://auth-server:8000/auth/realms/my-realm
    client_secret: some-secret
    client_id: kong
    realm: my-realm
    session_secret: some-section-secret

###################################################################

The Dockerfile:

FROM kong:latest
ENV KONG_PLUGINS="bundled, oidc"
USER root
RUN luarocks install kong-oidc

###################################################################

The docker-compose file

version: '3'
services:
  kong:
    image: kong-socotec
    container_name: kong
    build: .
    ports:
      - 8000:8000
      - 8443:8443
      - 8001:8001
      - 8444:8444
    environment:
      - KONG_DATABASE=off
      - KONG_DECLARATIVE_CONFIG=/usr/local/kong/declarative/kong.yml
      - KONG_PROXY_ACCESS_LOG=/dev/stdout
      - KONG_ADMIN_ACCESS_LOG=/dev/stdout
      - KONG_PROXY_ERROR_LOG=/dev/stderr
      - KONG_ADMIN_ERROR_LOG=/dev/stderr
      - KONG_ADMIN_LISTEN=0.0.0.0:8001,0.0.0.0:8444 ssl
      - KONG_PLUGINS=bundled,oidc
    volumes:
      - ./settings:/usr/local/kong/declarative
    networks:
      - rapsotec-network

networks:
  rapsotec-network:
    external: true

I am new in kong so sorry if it's more a kong issue than a kong-oidc issue.

For informations I tried to reproduce what I found here: https://github.com/nokia/kong-oidc/issues/136

Since there is no documentation in Kong about plugin config in declarative file.